User: user57  
  Date: 02/04/04 14:21:18

  Modified:    src/main/org/jboss/net/protocol/resource
                        ResourceURLConnection.java
  Log:
   o Added helper class for delegate URLConnection impls
   o Added URLStreamHandlerFactory.preload() to init the URL handler map
     for all JBoss specific protocols (in case the factory is changed)
  
  Revision  Changes    Path
  1.2       +3 -35     
jboss-common/src/main/org/jboss/net/protocol/resource/ResourceURLConnection.java
  
  Index: ResourceURLConnection.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss-common/src/main/org/jboss/net/protocol/resource/ResourceURLConnection.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResourceURLConnection.java        15 Feb 2002 06:14:17 -0000      1.1
  +++ ResourceURLConnection.java        4 Apr 2002 22:21:18 -0000       1.2
  @@ -10,36 +10,28 @@
   package org.jboss.net.protocol.resource;
   
   import java.io.IOException;
  -import java.io.InputStream;
   
  -import java.net.URLConnection;
   import java.net.URL;
   import java.net.MalformedURLException;
   
  -import java.security.Permission;
  +import org.jboss.net.protocol.DelegatingURLConnection;
   
   /**
    * Provides access to system resources as a URLConnection.
    *
  - * @version <tt>$Revision: 1.1 $</tt>
  + * @version <tt>$Revision: 1.2 $</tt>
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
    */
   public class ResourceURLConnection
  -   extends URLConnection
  +   extends DelegatingURLConnection
   {
  -   private URL delegateUrl;
  -   private URLConnection delegateConnection;
  -   
      public ResourceURLConnection(final URL url)
         throws MalformedURLException, IOException
      {
         super(url);
  -      
  -      delegateUrl = makeDelegateUrl(url);
  -      delegateConnection = delegateUrl.openConnection();
      }
   
  -   private URL makeDelegateUrl(final URL url)
  +   protected URL makeDelegateUrl(final URL url)
         throws MalformedURLException, IOException
      {
         String name = url.getHost();
  @@ -53,29 +45,5 @@
            throw new IOException("could not locate resource: " + name);
   
         return _url;
  -   }
  -
  -   public void connect() throws IOException {
  -      delegateConnection.connect();
  -   }
  -
  -   public Object getContent() throws IOException {
  -      return delegateConnection.getContent();
  -   }
  -
  -   public String getContentType() {
  -      return delegateConnection.getContentType();
  -   }
  -
  -   public InputStream getInputStream() throws IOException {
  -      return delegateConnection.getInputStream();
  -   }
  -
  -   public String getHeaderField(final String name) {
  -      return delegateConnection.getHeaderField(name);
  -   }
  -
  -   public Permission getPermission() throws IOException {
  -      return delegateConnection.getPermission();
      }
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to