@Singleton public class HttpUtils extends Object
Constructor and Description |
---|
HttpUtils(int connectionTimeout,
int soTimeout,
int globalMaxConnections,
int globalMaxConnectionsPerHost) |
@Inject public HttpUtils(@Named(value="jclouds.connection-timeout") int connectionTimeout, @Named(value="jclouds.so-timeout") int soTimeout, @Named(value="jclouds.max-connections-per-context") int globalMaxConnections, @Named(value="jclouds.max-connections-per-host") int globalMaxConnectionsPerHost)
public String getProxyHost()
org.jclouds.Constants.PROPERTY_PROXY_HOST
public Integer getProxyPort()
org.jclouds.Constants.PROPERTY_PROXY_PORT
public String getProxyUser()
org.jclouds.Constants.PROPERTY_PROXY_USER
public String getProxyPassword()
org.jclouds.Constants.PROPERTY_PROXY_PASSWORD
public int getSocketOpenTimeout()
public int getConnectionTimeout()
public boolean relaxHostname()
public boolean trustAllCerts()
public boolean useSystemProxies()
public int getMaxConnections()
public int getMaxConnectionsPerHost()
public static URI createBaseEndpointFor(URI endpoint)
public static com.google.common.collect.Multimap<String,String> getContentHeadersFromMetadata(ContentMetadata md)
public static byte[] toByteArrayOrNull(PayloadEnclosing response)
public static byte[] closeClientButKeepContentStream(PayloadEnclosing response)
IOException
public static void copy(ContentMetadata fromMd, MutableContentMetadata toMd)
public static URI createUri(String uriPath)
public void logRequest(Logger logger, HttpRequest request, String prefix)
public void logResponse(Logger logger, HttpResponse response, String prefix)
public static String sortAndConcatHeadersIntoString(com.google.common.collect.Multimap<String,String> headers)
public void checkRequestHasRequiredProperties(HttpRequest message)
public static void releasePayload(HttpMessage from)
public String valueOrEmpty(byte[] md5)
public String valueOrEmpty(Collection<String> collection)
public static Long attemptToParseSizeAndRangeFromHeaders(HttpMessage from) throws HttpException
HttpException
public static void checkRequestHasContentLengthOrChunkedEncoding(HttpMessage request, String message)
public static void wirePayloadIfEnabled(Wire wire, HttpMessage request)
Copyright © 2009-2012 jclouds. All Rights Reserved.