/** * URI constructor for HttpHost. * * @param uri the URI. */ public HttpHost(final URI uri) throws URIException { this(uri.getHost(), uri.getPort(), Protocol.getProtocol(uri.getScheme())); }
/** * Sets the protocol, host and port from the given URI. * @param uri the URI. */ public synchronized void setHost(final URI uri) { try { setHost(uri.getHost(), uri.getPort(), uri.getScheme()); } catch (URIException e) { throw new IllegalArgumentException(e.toString()); } }
getMethod = completionService.take().get(); URI uri = getMethod.getURI(); String instance = endpointsToServers.get(uri.getHost() + ":" + uri.getPort()); if (getMethod.getStatusCode() >= 300) { LOGGER.error("Server: {} returned error: {}", instance, getMethod.getStatusCode());
/** * @param method * @return the http status code of the execution * @throws IOException * @throws HttpException */ private int executeMethod(HttpMethod method) throws IOException, HttpException { String host = method.getURI().getHost(); if (host != null && nonProxyHosts.contains(host.toLowerCase())) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "Bypassing proxy config due to nonProxyHosts for " + method.getURI().toString()); } return client.executeMethod(hostConfigNoProxy, method); } return client.executeMethod(method); }
/** * Get the host name in this request header. * * @return Host name. */ public String getHostName() { String hostName = mHostName; try { // ZAP: fixed cases, where host name is null hostName = ((mUri.getHost() != null) ? mUri.getHost() : mHostName); } catch (URIException e) { if (log.isDebugEnabled()) { log.warn(e); } } return hostName; }
public static String getHostName(URI uri) throws URIException { StringBuilder host = new StringBuilder(); String scheme = uri.getScheme().toLowerCase(); host.append(scheme).append("://").append(uri.getHost()); int port = uri.getPort(); if (port != -1 && ((port == 80 && !"http".equals(scheme)) || (port == 443 && !"https".equals(scheme) || (port != 80 && port != 443)))) { host.append(":").append(port); } return host.toString(); }
private static String createBaseUri(org.apache.commons.httpclient.URI uri) throws URIException { StringBuilder baseUriBuilder = new StringBuilder(); baseUriBuilder.append(uri.getScheme()).append("://").append(uri.getHost()); if (uri.getPort() != -1) { baseUriBuilder.append(':').append(uri.getPort()); } return baseUriBuilder.toString(); }
/** * Returns the response address.<br> * Corresponds to the IP address of the responding server. * * @return The response address. */ @Override public String getServerAddress() { try { return getHttpMethod().getURI().getHost(); } catch (URIException e) { return null; } }
/** * URI constructor for HttpHost. * * @param uri the URI. */ public HttpHost(final URI uri) throws URIException { this(uri.getHost(), uri.getPort(), Protocol.getProtocol(uri.getScheme())); }
@SuppressWarnings("unused") public synchronized void setHost(URI uri) { try { setHost(uri.getHost(), uri.getPort(), uri.getScheme()); } catch(URIException e) { throw new IllegalArgumentException(e.toString()); } } }
/** * URI constructor for HttpHost. * * @param uri the URI. */ public HttpHost(final URI uri) throws URIException { this(uri.getHost(), uri.getPort(), Protocol.getProtocol(uri.getScheme())); }
/** * Sets the protocol, host and port from the given URI. * @param uri the URI. */ public synchronized void setHost(final URI uri) { try { setHost(uri.getHost(), uri.getPort(), uri.getScheme()); } catch (URIException e) { throw new IllegalArgumentException(e.toString()); } }
/** * Sets the protocol, host and port from the given URI. * @param uri the URI. */ public synchronized void setHost(final URI uri) { try { setHost(uri.getHost(), uri.getPort(), uri.getScheme()); } catch (URIException e) { throw new IllegalArgumentException(e.toString()); } }
/** * Sets the protocol, host and port from the given URI. * @param uri the URI. */ public synchronized void setHost(final URI uri) { try { setHost(uri.getHost(), uri.getPort(), uri.getScheme()); } catch (URIException e) { throw new IllegalArgumentException(e.toString()); } }
protected void fixClientHost(HttpMethod method) { try { // update client host, workaround for Exchange 2003 mailbox with an Exchange 2007 frontend URI currentUri = method.getURI(); if (currentUri != null && currentUri.getHost() != null && currentUri.getScheme() != null) { httpClient.getHostConfiguration().setHost(currentUri.getHost(), currentUri.getPort(), currentUri.getScheme()); } } catch (URIException e) { LOGGER.warn("Unable to update http client host:" + e.getMessage(), e); } }
/** * URI constructor for HttpHost. * * @param uri the URI. */ public HttpHost(final URI uri) throws URIException { this(uri.getHost(), uri.getPort(), Protocol.getProtocol(uri.getScheme())); }
/** * Sets the protocol, host and port from the given URI. * @param uri the URI. */ public synchronized void setHost(final URI uri) { try { setHost(uri.getHost(), uri.getPort(), uri.getScheme()); } catch (URIException e) { throw new IllegalArgumentException(e.toString()); } }
/** * URI constructor for HttpHost. * * @param uri the URI. */ public HttpHost(final URI uri) throws URIException { this(uri.getHost(), uri.getPort(), Protocol.getProtocol(uri.getScheme())); }
@SuppressWarnings("unused") public synchronized void setHost(URI uri) { try { setHost(uri.getHost(), uri.getPort(), uri.getScheme()); } catch(URIException e) { throw new IllegalArgumentException(e.toString()); } } }
@Override public synchronized void setHost(URI uri) { try { setHost(new HttpHost(uri.getHost(), uri.getPort(), getProtocol())); } catch (URIException e) { throw new IllegalArgumentException(e.toString()); } }; };