|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object classpathhelper.ClassStore
A base class that defines a store for class bytes. This would typically correspond to a jar file or directory.
Field Summary | |
protected CompositeClassStoreContentsFilter |
filters
Filters used in determining if a file in the store should be visible |
protected SessionCache |
sessionCache
|
Constructor Summary | |
protected |
ClassStore(java.lang.String locationDescription,
SessionCache theSessionCache)
|
Method Summary | |
void |
addClassStoreContentsFilter(ClassStoreContentsFilter filter)
Adds a new filter to this composite. |
abstract byte[] |
findBytes(java.lang.String path,
long[] checksum)
Method for looking up the bytes from a location in the given store. |
abstract byte[] |
findClassBytes(java.lang.String path,
java.lang.String classname,
long[] checksum)
Deprecated. Use findBytes(java.lang.String, long[]) . |
protected byte[] |
getBytes(java.io.InputStream in,
long[] checksum)
Internal helper method that copies the contents of an input stream into a byte array. |
abstract java.util.Iterator |
getClassNames()
Deprecated. Use getContentNames() . |
abstract java.util.Iterator |
getContentNames()
Enumerates a list of ContentDescription objects which correspond to files within this class store. |
java.lang.String |
getLocationDescription()
The name of this store. |
abstract java.lang.String |
getSeparator()
|
abstract java.net.URL |
getURL(java.lang.String path)
Returns a URL to the given entity. |
boolean |
removeClassStoreContentsFilter(ClassStoreContentsFilter filter)
Removes a filter from the composite. |
abstract void |
verifyClassStore()
Method used to test to see if this ClassStore is configured correctly. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SessionCache sessionCache
protected CompositeClassStoreContentsFilter filters
Constructor Detail |
protected ClassStore(java.lang.String locationDescription, SessionCache theSessionCache)
locationDescription
- The description of the location this class store
represents.Method Detail |
public abstract byte[] findClassBytes(java.lang.String path, java.lang.String classname, long[] checksum) throws java.lang.ClassNotFoundException
findBytes(java.lang.String, long[])
.
path
- The likely relative path of the classname (used as an
optimization to prevent ClassStores from needing to recalculate this
value on every call).classname
- The class to look up.checksum
- Optional output array (at least of length 1).
Can be null.
java.lang.ClassNotFoundException
- If the class is not in this store.public abstract byte[] findBytes(java.lang.String path, long[] checksum)
path
- The path within the store.checksum
- Optional output array (at least of length 1). Can
be null
.
null
if the element
could not be found.public abstract java.util.Iterator getClassNames()
getContentNames()
.
String
objects corresponding
to the classnames in this store.public abstract java.util.Iterator getContentNames()
ContentDescription
objects which correspond to files within this class store.
ContentDescription
objects corresponding
to the contents of the store.public abstract java.lang.String getSeparator()
ClassStoreContentsFilter
to allow it to correctly parse
the contents of the store. This differs from File.separator
in that some stores (such as jars) might always use a specific
separator.public abstract java.net.URL getURL(java.lang.String path) throws java.net.MalformedURLException
path
- a forward slash /
seperated path to the element.
null
if the
object is not found.
java.net.MalformedURLException
public abstract void verifyClassStore() throws java.lang.Exception
Method used to test to see if this ClassStore is configured correctly. Subclasses will throw exceptions if any problem exists with the configuration.
When successful this method just returns.
java.lang.Exception
- The problem with the configuration.public java.lang.String getLocationDescription()
public void addClassStoreContentsFilter(ClassStoreContentsFilter filter)
filter
- The new filter object.public boolean removeClassStoreContentsFilter(ClassStoreContentsFilter filter)
filter
- The filter to remove.
true
If the filter was in the composite, otherwise
false
protected byte[] getBytes(java.io.InputStream in, long[] checksum) throws java.io.IOException
in
- The input stream. Will be read to end, but not closed.checksum
- Optional array of size 1 to return the checksum from the
bytes into. Can be null
.
java.io.IOException
- If an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |