|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceHandle
This is a handle (a connection) to some resource, which may
be a class, native library, text file, image, etc. Handles are returned
by a ResourceFinder. A resource handle allows easy access to the resource data
(using methods getInputStream()
or getBytes()
) as well as
access resource metadata, such as attributes, certificates, etc.
close()
d, similarly to I/O streams.
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. |
java.net.URL |
getCodeSourceUrl()
Returns the CodeSource URL for the class or resource. |
int |
getContentLength()
Returns the length of this resource data, or -1 if unknown. |
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. |
java.lang.String |
getName()
Return the name of the resource. |
java.net.URL |
getUrl()
Returns the URL of the resource. |
boolean |
isDirectory()
Does this resource refer to a directory. |
Method Detail |
---|
java.lang.String getName()
java.net.URL getUrl()
boolean isDirectory()
java.net.URL getCodeSourceUrl()
java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
int getContentLength()
byte[] getBytes() throws java.io.IOException
java.io.IOException
java.util.jar.Manifest getManifest() throws java.io.IOException
java.io.IOException
java.security.cert.Certificate[] getCertificates()
java.util.jar.Attributes getAttributes() throws java.io.IOException
java.io.IOException
void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |