本文整理了Java中org.eclipse.jetty.client.api.Request.getURI
方法的一些代码示例,展示了Request.getURI
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getURI
方法的具体详情如下:
包路径:org.eclipse.jetty.client.api.Request
类名称:Request
方法名:getURI
暂无
代码示例来源:origin: spring-projects/spring-framework
@Override
public URI getURI() {
return this.jettyRequest.getURI();
}
代码示例来源:origin: org.springframework/spring-web
@Override
public URI getURI() {
return this.jettyRequest.getURI();
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
@Override
protected URI getAuthenticationURI(Request request)
{
return request.getURI();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-web
@Override
public URI getURI() {
return this.jettyRequest.getURI();
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public URI getURI() {
return this.jettyRequest.getURI();
}
代码示例来源:origin: census-instrumentation/opencensus-java
@Override
public String getUrl(Request request) {
try {
return request.getURI().toURL().toString();
} catch (MalformedURLException e) {
return "";
}
}
}
代码示例来源:origin: org.apache.camel/camel-jetty9
public String getUrl() {
try {
return this.request.getURI().toURL().toExternalForm();
} catch (MalformedURLException e) {
throw new IllegalStateException(e.getMessage(), e);
}
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
@Override
public void apply(Request request)
{
if (request.getURI().toString().startsWith(uri.toString()))
request.header(HttpHeader.AUTHORIZATION.asString(), value);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
@Override
public void apply(Request request)
{
if (request.getURI().toString().startsWith(uri.toString()))
request.header(HttpHeader.AUTHORIZATION.asString(), value);
}
代码示例来源:origin: io.digdag/digdag-standards
private String safeUri(Request request, boolean uriIsSecret)
{
URI uri = request.getURI();
if (uriIsSecret) {
return uri.getScheme() + "://***";
}
URI safeUri;
try {
safeUri = new URI(uri.getScheme(), null, uri.getHost(), uri.getPort(), uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment());
}
catch (URISyntaxException e) {
throw Throwables.propagate(e);
}
return safeUri.toString();
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
@Override
public Result authenticate(Request request, ContentResponse response, String wwwAuthenticate, Attributes context)
{
String encoding = StringUtil.__ISO_8859_1;
String value = "Basic " + B64Code.encode(user + ":" + password, encoding);
return new BasicResult(request.getURI(), value);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
@Override
public Result authenticate(Request request, ContentResponse response, String wwwAuthenticate, Attributes context)
{
String encoding = StringUtil.__ISO_8859_1;
String value = "Basic " + B64Code.encode(user + ":" + password, encoding);
return new BasicResult(request.getURI(), value);
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
@Override
public Result authenticate(Request request, ContentResponse response, String wwwAuthenticate, Attributes context)
{
// Avoid case sensitivity problems on the 'D' character
String type = "igest";
wwwAuthenticate = wwwAuthenticate.substring(wwwAuthenticate.indexOf(type) + type.length());
Map<String, String> params = parseParams(wwwAuthenticate);
String nonce = params.get("nonce");
if (nonce == null || nonce.length() == 0)
return null;
String opaque = params.get("opaque");
String algorithm = params.get("algorithm");
if (algorithm == null)
algorithm = "MD5";
MessageDigest digester = getMessageDigest(algorithm);
if (digester == null)
return null;
String serverQOP = params.get("qop");
String clientQOP = null;
if (serverQOP != null)
{
List<String> serverQOPValues = Arrays.asList(serverQOP.split(","));
if (serverQOPValues.contains("auth"))
clientQOP = "auth";
else if (serverQOPValues.contains("auth-int"))
clientQOP = "auth-int";
}
return new DigestResult(request.getURI(), response.getContent(), realm, user, password, algorithm, nonce, clientQOP, opaque);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
@Override
public Result authenticate(Request request, ContentResponse response, String wwwAuthenticate, Attributes context)
{
// Avoid case sensitivity problems on the 'D' character
String type = "igest";
wwwAuthenticate = wwwAuthenticate.substring(wwwAuthenticate.indexOf(type) + type.length());
Map<String, String> params = parseParams(wwwAuthenticate);
String nonce = params.get("nonce");
if (nonce == null || nonce.length() == 0)
return null;
String opaque = params.get("opaque");
String algorithm = params.get("algorithm");
if (algorithm == null)
algorithm = "MD5";
MessageDigest digester = getMessageDigest(algorithm);
if (digester == null)
return null;
String serverQOP = params.get("qop");
String clientQOP = null;
if (serverQOP != null)
{
List<String> serverQOPValues = Arrays.asList(serverQOP.split(","));
if (serverQOPValues.contains("auth"))
clientQOP = "auth";
else if (serverQOPValues.contains("auth-int"))
clientQOP = "auth-int";
}
return new DigestResult(request.getURI(), response.getContent(), realm, user, password, algorithm, nonce, clientQOP, opaque);
}
代码示例来源:origin: com.cisco.oss.foundation/http-client-jetty
@Override
public HttpResponse executeDirect(HttpRequest request){
Request httpRequest = prepareRequest(request);
try {
ContentResponse contentResponse = httpRequest.send();
return new JettyHttpResponse(contentResponse, httpRequest.getURI());
} catch (InterruptedException e) {
throw new ClientException(e.toString(), e);
} catch (TimeoutException e) {
throw new RequestTimeoutException(e.toString(), e);
} catch (ExecutionException e) {
throw new ClientException(e.toString(), e);
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
@Override
protected URI getAuthenticationURI(Request request)
{
HttpDestination destination = getHttpClient().destinationFor(request.getScheme(), request.getHost(), request.getPort());
ProxyConfiguration.Proxy proxy = destination.getProxy();
return proxy != null ? proxy.getURI() : request.getURI();
}
代码示例来源:origin: allegro/hermes
SingleMessageSendingResult(Result result) {
this.failure = result.getFailure();
if (result.getResponse() != null) {
initializeForStatusCode(result.getResponse().getStatus());
if (isStatusCodeServiceUnavailable()) {
initializeRetryAfterMillis(result);
}
}
this.loggable = !isTimeout() && !hasHttpAnswer();
this.requestUri = Optional.ofNullable(result.getRequest().getURI());
}
代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers
SingleMessageSendingResult(Result result) {
this.failure = result.getFailure();
if (result.getResponse() != null) {
initializeForStatusCode(result.getResponse().getStatus());
if (isStatusCodeServiceUnavailable()) {
initializeRetryAfterMillis(result);
}
}
this.loggable = !isTimeout() && !hasHttpAnswer();
this.requestUri = Optional.ofNullable(result.getRequest().getURI());
}
代码示例来源:origin: census-instrumentation/opencensus-java
@Test
public void testExtraction() {
HttpFields fields = new HttpFields();
fields.add(new HttpField("User-Agent", "Test 1.0"));
Request request = mock(Request.class);
Response response = mock(Response.class);
OcJettyHttpClientExtractor extractor = new OcJettyHttpClientExtractor();
when(request.getHost()).thenReturn("localhost");
when(request.getMethod()).thenReturn("GET");
when(request.getHeaders()).thenReturn(fields);
when(request.getPath()).thenReturn("/test");
when(request.getURI()).thenReturn(uri);
when(response.getStatus()).thenReturn(0);
assertThat(extractor.getHost(request)).contains("localhost");
assertThat(extractor.getMethod(request)).contains("GET");
assertThat(extractor.getPath(request)).contains("/test");
assertThat(extractor.getUrl(request)).contains(URI_STR);
assertThat(extractor.getRoute(request)).contains("");
assertThat(extractor.getUserAgent(request)).contains("Test 1.0");
assertThat(extractor.getStatusCode(response)).isEqualTo(0);
}
}
代码示例来源:origin: com.cisco.oss.foundation/http-client-jetty
@Override
public void onComplete(Result result) {
Throwable failure = result.getFailure();
URI uri = result.getRequest().getURI();
if (failure != null) {
try {
内容来源于网络,如有侵权,请联系作者删除!