org.apache.geronimo.kernel.classloader
Class DirectoryResourceHandle

java.lang.Object
  extended by org.apache.geronimo.kernel.classloader.AbstractResourceHandle
      extended by org.apache.geronimo.kernel.classloader.DirectoryResourceHandle
All Implemented Interfaces:
ResourceHandle

public class DirectoryResourceHandle
extends AbstractResourceHandle


Constructor Summary
DirectoryResourceHandle(String name, File file, File codeSource, Manifest manifest)
           
 
Method Summary
 Attributes getAttributes()
          Return the Attributes of the resource, or null if none.
 Certificate[] getCertificates()
          Always return null.
 URL getCodeSourceUrl()
          Returns the CodeSource URL for the class or resource.
 int getContentLength()
          Returns the length of this resource data, or -1 if unknown.
 InputStream getInputStream()
          Returns and InputStream for reading this resource data.
 Manifest getManifest()
          Returns the Manifest of the JAR file from which this resource was loaded, or null if none.
 String getName()
          Return the name of the resource.
 URL getUrl()
          Returns the URL of the resource.
 boolean isDirectory()
          Does this resource refer to a directory.
 
Methods inherited from class org.apache.geronimo.kernel.classloader.AbstractResourceHandle
close, getBytes, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryResourceHandle

public DirectoryResourceHandle(String name,
                               File file,
                               File codeSource,
                               Manifest manifest)
                        throws MalformedURLException
Throws:
MalformedURLException
Method Detail

getName

public String getName()
Description copied from interface: ResourceHandle
Return the name of the resource. The name is a "/"-separated path name that identifies the resource.


getUrl

public URL getUrl()
Description copied from interface: ResourceHandle
Returns the URL of the resource.


getCodeSourceUrl

public URL getCodeSourceUrl()
Description copied from interface: ResourceHandle
Returns the CodeSource URL for the class or resource.


isDirectory

public boolean isDirectory()
Description copied from interface: ResourceHandle
Does this resource refer to a directory. Directory resources are commly used as the basis for a URL in client application. A directory resource has 0 bytes for it's content.


getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: ResourceHandle
Returns and InputStream for reading this resource data.

Throws:
IOException

getContentLength

public int getContentLength()
Description copied from interface: ResourceHandle
Returns the length of this resource data, or -1 if unknown.


getManifest

public Manifest getManifest()
                     throws IOException
Description copied from interface: ResourceHandle
Returns the Manifest of the JAR file from which this resource was loaded, or null if none.

Specified by:
getManifest in interface ResourceHandle
Overrides:
getManifest in class AbstractResourceHandle
Throws:
IOException

getAttributes

public Attributes getAttributes()
                         throws IOException
Description copied from interface: ResourceHandle
Return the Attributes of the resource, or null if none.

Specified by:
getAttributes in interface ResourceHandle
Overrides:
getAttributes in class AbstractResourceHandle
Throws:
IOException

getCertificates

public Certificate[] getCertificates()
Always return null. This could be implementd by verifing the signatures in the manifest file against the actual file, but we don't need this right now.

Specified by:
getCertificates in interface ResourceHandle
Overrides:
getCertificates in class AbstractResourceHandle
Returns:
null


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.