|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.emory.mathcs.util.classloader.ResourceHandle
This class represents a handle (a connection) to some resource, which may
be a class, native library, text file, image, etc. Handles are returned
by ResourceLoader
's get methods.
Having the resource handle, in addition to accessing the resource data
(using methods getInputStream()
or getBytes()
) as well as
access resource metadata, such as attributes, certificates, etc.
As soon as the handle is no longer in use, it should be explicitly
close()
d, similarly to I/O streams.
Constructor Summary | |
ResourceHandle()
|
Method Summary | |
void |
close()
Closes a connection to the resource indentified by this handle. |
java.util.jar.Attributes |
getAttributes()
Return the Attributes of the resource, or null if none. |
byte[] |
getBytes()
Returns this resource data as an array of bytes. |
java.security.cert.Certificate[] |
getCertificates()
Return the Certificates of the resource, or null if none. |
abstract java.net.URL |
getCodeSourceURL()
Returns the CodeSource URL for the class or resource. |
abstract int |
getContentLength()
Returns the length of this resource data, or -1 if unknown. |
abstract java.io.InputStream |
getInputStream()
Returns and InputStream for reading this resource data. |
java.util.jar.Manifest |
getManifest()
Returns the Manifest of the JAR file from which this resource was loaded, or null if none. |
abstract java.lang.String |
getName()
Return the name of the resource. |
abstract java.net.URL |
getURL()
Returns the URL of the resource. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ResourceHandle()
Method Detail |
public abstract java.lang.String getName()
public abstract java.net.URL getURL()
public abstract java.net.URL getCodeSourceURL()
public abstract java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public abstract int getContentLength()
public byte[] getBytes() throws java.io.IOException
java.io.IOException
public java.util.jar.Manifest getManifest() throws java.io.IOException
java.io.IOException
public java.security.cert.Certificate[] getCertificates()
public java.util.jar.Attributes getAttributes() throws java.io.IOException
java.io.IOException
public void close()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |