/[classpath]/classpath/java/net/URLConnection.java
ViewVC logotype

Diff of /classpath/java/net/URLConnection.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mark, Tue Jan 22 22:27:00 2002 UTC revision 1.8 by mark, Fri Oct 18 20:40:50 2002 UTC
# Line 1  Line 1 
1  /* URLConnection.java -- Abstract superclass for reading from URL's  /* URLConnection.java -- Abstract superclass for reading from URL's
2     Copyright (C) 1998 Free Software Foundation, Inc.     Copyright (C) 1998, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 45  import java.security.Permission; Line 45  import java.security.Permission;
45  import java.text.DateFormat;  import java.text.DateFormat;
46  import java.text.ParsePosition;  import java.text.ParsePosition;
47  import java.text.ParseException;  import java.text.ParseException;
48    import java.util.Collections;
49  import java.util.Date;  import java.util.Date;
50  import java.util.Enumeration;  import java.util.Enumeration;
51  import java.util.Hashtable;  import java.util.Hashtable;
52    import java.util.Map;
53  import java.util.Locale;  import java.util.Locale;
54    
55  /**  /**
# Line 178  protected URL url; Line 180  protected URL url;
180  /**  /**
181    * The list of request properties for this connection    * The list of request properties for this connection
182    */    */
183  private Hashtable req_props = new Hashtable(10);  private final Hashtable req_props;
184    
185  /*************************************************************************/  /*************************************************************************/
186    
# Line 355  URLConnection(URL url) Line 357  URLConnection(URL url)
357    allowUserInteraction = def_allow_user_inter;    allowUserInteraction = def_allow_user_inter;
358    useCaches = def_use_caches;    useCaches = def_use_caches;
359    
360    Enumeration e = def_req_props.keys();    req_props = new Hashtable(def_req_props);
   while (e.hasMoreElements())  
     {  
       String key = (String)e.nextElement();  
       String value = (String)def_req_props.get(key);  
   
       req_props.put(key, value);  
     }  
361  }  }
362    
363  /*************************************************************************/  /*************************************************************************/
# Line 571  getRequestProperty(String key) Line 566  getRequestProperty(String key)
566    * @param key The name of the property    * @param key The name of the property
567    * @param value The value of the property    * @param value The value of the property
568    */    */
569  public synchronized void  public void
570  setRequestProperty(String key, String value)  setRequestProperty(String key, String value)
571  {  {
572    req_props.put(key.toLowerCase(), value);    req_props.put(key.toLowerCase(), value);
573  }  }
574    
575    /**
576     * Returns an unmodifiable Map containing the request properties.
577     *
578     * @since 1.4
579     */
580    public Map
581    getRequestProperties()
582    {
583      return Collections.unmodifiableMap(req_props);
584    }
585    
586  /*************************************************************************/  /*************************************************************************/
587    
588  /**  /**

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26