本文整理了Java中com.ning.http.client.uri.Uri.toUrl()
方法的一些代码示例,展示了Uri.toUrl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Uri.toUrl()
方法的具体详情如下:
包路径:com.ning.http.client.uri.Uri
类名称:Uri
方法名:toUrl
暂无
代码示例来源:origin: com.ning/async-http-client
@Override
public String toString() {
// for now, but might change
return toUrl();
}
代码示例来源:origin: com.ning/async-http-client
@Override
public String getUrl() {
return uri.toUrl();
}
代码示例来源:origin: com.ning/async-http-client
public URI toJavaNetURI() throws URISyntaxException {
return new URI(toUrl());
}
代码示例来源:origin: com.ning/async-http-client
public static String computeRealmURI(Uri uri, boolean useAbsoluteURI, boolean omitQuery) {
if (useAbsoluteURI) {
return omitQuery && MiscUtils.isNonEmpty(uri.getQuery()) ? uri.withNewQuery(null).toUrl() : uri.toUrl();
} else {
String path = getNonEmptyPath(uri);
return omitQuery || !MiscUtils.isNonEmpty(uri.getQuery()) ? path : path + "?" + uri.getQuery();
}
}
代码示例来源:origin: com.ning/async-http-client
@Override
public AsyncHandler.STATE onStatusReceived(final HttpResponseStatus status) throws Exception {
responseBuilder.accumulate(status);
if (status.getStatusCode() == 200 || status.getStatusCode() == 206) {
url = status.getUri().toUrl();
} else {
return AsyncHandler.STATE.ABORT;
}
if (decoratedAsyncHandler != null) {
return decoratedAsyncHandler.onStatusReceived(status);
}
return AsyncHandler.STATE.CONTINUE;
}
代码示例来源:origin: com.ning/async-http-client
private String requestUri(Uri uri, ProxyServer proxyServer, boolean connect) {
if (connect)
return getAuthority(uri);
else if (proxyServer != null && !(useProxyConnect(uri) && config.isUseRelativeURIsWithConnectProxies()))
return uri.toUrl();
else {
String path = getNonEmptyPath(uri);
if (isNonEmpty(uri.getQuery()))
return path + "?" + uri.getQuery();
else
return path;
}
}
代码示例来源:origin: javaee/grizzly-ahc
@Override
public String toString() {
// for now, but might change
return toUrl();
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client
@Override
public String toString() {
// for now, but might change
return toUrl();
}
代码示例来源:origin: javaee/grizzly-ahc
@Override
public String getUrl() {
return uri.toUrl();
}
代码示例来源:origin: outbrain/ob1k
@Override
public String getUrl() {
return ningResponse.getUri().toUrl();
}
代码示例来源:origin: com.ning/async-http-client
builder.uri(uri.toUrl());
} else {
builder.uri(AsyncHttpProviderUtils.getNonEmptyPath(uri))
代码示例来源:origin: com.ning/async-http-client
Uri uri = Uri.create(future.getUri(), location);
future.setUri(uri);
String newUrl = uri.toUrl();
if (request.getUri().getScheme().startsWith(WEBSOCKET)) {
newUrl = newUrl.replaceFirst(HTTP, WEBSOCKET);
代码示例来源:origin: javaee/grizzly-ahc
public void onBytesReceived(Uri uri, long amount, long current, long total) {
assertEquals(uri.toUrl(), getTargetUrl());
assertEquals(total, -1);
}
};
代码示例来源:origin: javaee/grizzly-ahc
public void onStatus(Uri uri, int statusCode, String statusText) {
assertEquals(statusCode, 200);
assertEquals(uri.toUrl(), getTargetUrl());
}
代码示例来源:origin: javaee/grizzly-ahc
public void onBytesSent(Uri uri, long amount, long current, long total) {
assertEquals(uri.toUrl(), getTargetUrl());
assertEquals(total, MY_MESSAGE.getBytes().length);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client
public static String computeRealmURI(Uri uri, boolean useAbsoluteURI, boolean omitQuery) {
if (useAbsoluteURI) {
return omitQuery && MiscUtils.isNonEmpty(uri.getQuery()) ? uri.withNewQuery(null).toUrl() : uri.toUrl();
} else {
String path = getNonEmptyPath(uri);
return omitQuery || !MiscUtils.isNonEmpty(uri.getQuery()) ? path : path + "?" + uri.getQuery();
}
}
代码示例来源:origin: javaee/grizzly-ahc
public void onHeaders(Uri uri, HeaderMap headers) {
assertEquals(uri.toUrl(), getTargetUrl());
assertNotNull(headers);
assertTrue(!headers.isEmpty());
assertEquals(headers.getFirstValue("X-Custom"), "custom");
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client
@Override
public AsyncHandler.STATE onStatusReceived(final HttpResponseStatus status) throws Exception {
responseBuilder.accumulate(status);
if (status.getStatusCode() == 200 || status.getStatusCode() == 206) {
url = status.getUri().toUrl();
} else {
return AsyncHandler.STATE.ABORT;
}
if (decoratedAsyncHandler != null) {
return decoratedAsyncHandler.onStatusReceived(status);
}
return AsyncHandler.STATE.CONTINUE;
}
代码示例来源:origin: javaee/grizzly-ahc
@Override
public AsyncHandler.STATE onStatusReceived(final HttpResponseStatus status) throws Exception {
responseBuilder.accumulate(status);
if (status.getStatusCode() == 200 || status.getStatusCode() == 206) {
url = status.getUri().toUrl();
} else {
return AsyncHandler.STATE.ABORT;
}
if (decoratedAsyncHandler != null) {
return decoratedAsyncHandler.onStatusReceived(status);
}
return AsyncHandler.STATE.CONTINUE;
}
代码示例来源:origin: com.virjar/dungproxy-client
@Override
public <T> ListenableFuture<T> execute(Request request, AsyncHandler<T> handler) {
Uri uri = request.getUri();
if (request.getProxyServer() == null) {// 在这里绑定IP池
AvProxy proxy = ipPool.bind(uri.getHost(), uri.toUrl());
if (proxy != null) {
return delegate.execute(new DungProxyRequest(request, proxy),
new DungProxyHandler<>(proxy, handler));
}
}
return delegate.execute(request, handler);
}
内容来源于网络,如有侵权,请联系作者删除!