Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4442754

class java.net.URL should have methods to set proxy attributes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs
    • generic
    • generic



      Name: boT120536 Date: 04/12/2001


      java version "1.3.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
      Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)

      The URL class currently depends on System properties to specify proxy settings,
      as follows:

      System.getProperties().put( "proxySet", "true" );
      System.getProperties().put( "proxyHost", "myProxyMachineName" );
      System.getProperties().put( "proxyPort", "85" );

      However, it is not desirable that these settings be global. In our
      application, we open some URLs without proxy, others with different proxies.
      The URL class should allow setting and getting these properties directly, e.g.

      boolean URL.getUseProxy()
      void URL.setUseProxy(boolean)
      (default is System.property; if unspecified, false)

      String URL.getProxyHost()
      void URL.setProxyHost(String)

      integer URL.getProxyPort()
      void URL.setProxyPort(integer)

      With these additions, it would never be necessary to add properties to the
      System property list (unless global default values were desired).

      The values in the System property list can still be used as defaults for
      backward compatibility.
      (Review ID: 120605)
      ======================================================================

            jccollet Jean-Christophe Collet (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: