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

new protocol handlers need a setURL interface from URLStreamHandler

XMLWordPrintable

    • 1.0beta2
    • sparc
    • solaris_2.4
    • Not verified

      ----- Begin Included Message -----

      From vbo Thu Nov 16 10:46:49 1995
      To: sami
      Subject: Re: api changes
      Cc: java-tools@sunpro
      X-Sun-Charset: US-ASCII

      I heard you were collecting api changes for 1.0. I sent you this some time
      ago and haven't heard back from you on it, so here a reminder about an api
      change needed in java.net.URLStreamHandler to allow people to define their
      own URL stream handler subclasses.

      Thanks.


      - Van


      ----- Begin Included Message -----

      From vbo Thu Oct 12 15:05:35 1995
      To: sami
      Subject: a bug fix for a problem in java.net.URLStreamHandler
      X-Sun-Charset: US-ASCII

      Sami,

      It's me again, from DevPro-land with another suggested fix for you. Thanks
      for including the last one I sent you in java.awt.

      I needed to add a new URL protocol handler, and as luck would have it, the
      new protocol is the first protocol under sun.net.www.protocol to attempt to
      override the parseURL method provided by the superclass
      java.net.URLStreamHandler.

      I found myself unable to write a new parseURL method, however, because it
      needs to use the protected set() method in the java.net.URL class. According
      to a comment in the URL class, only new protocol handlers, derived from
      URLStreamHandler, should be allowed to call the set() method on a URL. The
      new protocol qualifies, but because it's in a different package it cannot
      access protected methods in java.net.URL.

      My solution is to provide a protected method in the URLStreamHandler class
      that new handlers (derived from URLStreamHandler) can call to set a URL.

      If you agree, please add the following method to the end of the
      URLStreamHandler class in src/share/java/java/net/URLStreamHandler.java:

          /**
           * Calls the (protected) set method out of the URL given. Only
           * classes derived from URLStreamHandler are supposed to be able
           * to call the set() method on a URL.
           * @see URL#set
           */
          protected void setURL(URL u, String protocol, String host, int port,
      String file, String ref) {
            u.set(protocol, host, port, file, ref);
          }


      Thanks.



      - Van


      ----- End Included Message -----

            tballsunw Tom Ball (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: