jdk/src/java.base/share/classes/sun/net/www/URLConnection.java
changeset 32649 2ee9017c7597
parent 25859 3317bb8137f4
equal deleted inserted replaced
32648:1fa861caf840 32649:2ee9017c7597
    32  * A class to represent an active connection to an object
    32  * A class to represent an active connection to an object
    33  * represented by a URL.
    33  * represented by a URL.
    34  * @author  James Gosling
    34  * @author  James Gosling
    35  */
    35  */
    36 
    36 
    37 abstract public class URLConnection extends java.net.URLConnection {
    37 public abstract class URLConnection extends java.net.URLConnection {
    38 
    38 
    39     /** The URL that it is connected to */
    39     /** The URL that it is connected to */
    40 
    40 
    41     private String contentType;
    41     private String contentType;
    42     private int contentLength = -1;
    42     private int contentLength = -1;
   234         url = null;
   234         url = null;
   235     }
   235     }
   236 
   236 
   237     private static HashMap<String,Void> proxiedHosts = new HashMap<>();
   237     private static HashMap<String,Void> proxiedHosts = new HashMap<>();
   238 
   238 
   239     public synchronized static void setProxiedHost(String host) {
   239     public static synchronized void setProxiedHost(String host) {
   240         proxiedHosts.put(host.toLowerCase(), null);
   240         proxiedHosts.put(host.toLowerCase(), null);
   241     }
   241     }
   242 
   242 
   243     public synchronized static boolean isProxiedHost(String host) {
   243     public static synchronized boolean isProxiedHost(String host) {
   244         return proxiedHosts.containsKey(host.toLowerCase());
   244         return proxiedHosts.containsKey(host.toLowerCase());
   245     }
   245     }
   246 }
   246 }