HTTPConnection conn = new HTTPConnection(url);
conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
NVPair[] headerPairs = toNVPair(headers.getRequestHeaders(), //
Collections.singleton(new CaseInsensitiveStringWrapper(HttpHeaders.HOST)));
conn.setAllowUserInteraction(false);
NVPair credentials = getCredentials(url);
if (credentials != null)
{
conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
}
HTTPResponse resp = conn.Get(url.getFile(), (NVPair[])null, headerPairs);
if (resp.getStatusCode() >= 300)
{
if (LOG.isDebugEnabled())