src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
Print this page
@@ -411,17 +411,17 @@
final URL url,
final RequestorType authType) {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<PasswordAuthentication>() {
public PasswordAuthentication run() {
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Requesting Authentication: host =" + host + " url = " + url);
}
PasswordAuthentication pass = Authenticator.requestPasswordAuthentication(
host, addr, port, protocol,
prompt, scheme, url, authType);
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Authentication returned: " + (pass != null ? pass.toString() : "null"));
}
return pass;
}
});
@@ -630,11 +630,11 @@
}
if (!chunked) {
if (requests.findValue("Transfer-Encoding") != null) {
requests.remove("Transfer-Encoding");
- if (logger.isLoggable(PlatformLogger.WARNING)) {
+ if (logger.isLoggable(PlatformLogger.Level.WARNING)) {
logger.warning(
"use streaming mode for chunked encoding");
}
}
}
@@ -643,11 +643,11 @@
// add them to the existing request headers
setCookieHeader();
setRequests=true;
}
- if (logger.isLoggable(PlatformLogger.FINE)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine(requests.toString());
}
http.writeRequests(requests, poster, streaming());
if (ps.checkError()) {
String proxyHost = http.getProxyHostUsed();
@@ -989,11 +989,11 @@
cachedResponse = cacheHandler.get(uri, getRequestMethod(), requests.getHeaders(EXCLUDE_HEADERS));
if ("https".equalsIgnoreCase(uri.getScheme())
&& !(cachedResponse instanceof SecureCacheResponse)) {
cachedResponse = null;
}
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Cache Request for " + uri + " / " + getRequestMethod());
logger.finest("From cache: " + (cachedResponse != null ? cachedResponse.toString() : "null"));
}
if (cachedResponse != null) {
cachedHeaders = mapToMessageHeader(cachedResponse.getHeaders());
@@ -1030,11 +1030,11 @@
return ProxySelector.getDefault();
}
});
if (sel != null) {
URI uri = sun.net.www.ParseUtil.toURI(url);
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("ProxySelector Request for " + uri);
}
Iterator<Proxy> it = sel.select(uri).iterator();
Proxy p;
while (it.hasNext()) {
@@ -1047,11 +1047,11 @@
// make sure to construct new connection if first
// attempt failed
http = getNewHttpClient(url, p, connectTimeout, false);
http.setReadTimeout(readTimeout);
}
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
if (p != null) {
logger.finest("Proxy used: " + p.toString());
}
}
break;
@@ -1306,18 +1306,18 @@
requests.remove("Cookie");
requests.remove("Cookie2");
URI uri = ParseUtil.toURI(url);
if (uri != null) {
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("CookieHandler request for " + uri);
}
Map<String, List<String>> cookies
= cookieHandler.get(
uri, requests.getHeaders(EXCLUDE_HEADERS));
if (!cookies.isEmpty()) {
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Cookies retrieved: " + cookies.toString());
}
for (Map.Entry<String, List<String>> entry :
cookies.entrySet()) {
String key = entry.getKey();
@@ -1474,18 +1474,18 @@
if (!streaming()) {
writeRequests();
}
http.parseHTTP(responses, pi, this);
- if (logger.isLoggable(PlatformLogger.FINE)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine(responses.toString());
}
boolean b1 = responses.filterNTLMResponses("WWW-Authenticate");
boolean b2 = responses.filterNTLMResponses("Proxy-Authenticate");
if (b1 || b2) {
- if (logger.isLoggable(PlatformLogger.FINE)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine(">>>> Headers are filtered");
logger.fine(responses.toString());
}
}
@@ -1941,16 +1941,16 @@
// There is no need to track progress in HTTP Tunneling,
// so ProgressSource is null.
http.parseHTTP(responses, null, this);
/* Log the response to the CONNECT */
- if (logger.isLoggable(PlatformLogger.FINE)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine(responses.toString());
}
if (responses.filterNTLMResponses("Proxy-Authenticate")) {
- if (logger.isLoggable(PlatformLogger.FINE)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine(">>>> Headers are filtered");
logger.fine(responses.toString());
}
}
@@ -2073,11 +2073,11 @@
}
setPreemptiveProxyAuthentication(requests);
/* Log the CONNECT request */
- if (logger.isLoggable(PlatformLogger.FINE)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine(requests.toString());
}
http.writeRequests(requests, null);
}
@@ -2216,11 +2216,11 @@
break;
case KERBEROS:
ret = new NegotiateAuthentication(new HttpCallerInfo(authhdr.getHttpCallerInfo(), "Kerberos"));
break;
case UNKNOWN:
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
}
/*fall through*/
default:
throw new AssertionError("should not reach here");
@@ -2245,11 +2245,11 @@
if (!ret.setHeaders(this, p, raw)) {
ret = null;
}
}
}
- if (logger.isLoggable(PlatformLogger.FINER)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINER)) {
logger.finer("Proxy Authentication for " + authhdr.toString() +" returned " + (ret != null ? ret.toString() : "null"));
}
return ret;
}
@@ -2375,11 +2375,11 @@
/* set to false so that we do not try again */
tryTransparentNTLMServer = false;
}
break;
case UNKNOWN:
- if (logger.isLoggable(PlatformLogger.FINEST)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
}
/*fall through*/
default:
throw new AssertionError("should not reach here");
@@ -2402,11 +2402,11 @@
if (!ret.setHeaders(this, p, raw)) {
ret = null;
}
}
}
- if (logger.isLoggable(PlatformLogger.FINER)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINER)) {
logger.finer("Server Authentication for " + authhdr.toString() +" returned " + (ret != null ? ret.toString() : "null"));
}
return ret;
}
@@ -2530,11 +2530,11 @@
{
disconnectInternal();
if (streaming()) {
throw new HttpRetryException (RETRY_MSG3, stat, loc);
}
- if (logger.isLoggable(PlatformLogger.FINE)) {
+ if (logger.isLoggable(PlatformLogger.Level.FINE)) {
logger.fine("Redirected from " + url + " to " + locUrl);
}
// clear out old response headers!!!!
responses = new MessageHeader();