|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.util.lang.classpath.ClassPathContext
public final class ClassPathContext
A constraint on resources to be loaded from the class path.
Constructor Summary | |
---|---|
ClassPathContext(ClassLoader classLoader, String archiveRoot) Default constructor. |
Method Summary | |
---|---|
URL |
createUrl(String resource) Constructs the URL to the resource. |
boolean |
equals(Object object) Returns true if the given object is semantically equal to the given object, false otherwise. |
URL |
getResource(String resource) Constructs the URL to the resource. |
InputStream |
getResourceAsStream(String resource) Opens the stream to the resource. |
int |
hashCode() Returns the hash code of the object. |
String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClassPathContext(ClassLoader classLoader, String archiveRoot) throws NullPointerException
classLoader
- the class loader to load the directory listings.
archiveRoot
- the value for archiveRoot.
NullPointerException
- if
classLoader
is
null
.
Method Detail |
---|
public URL getResource(String resource)
resource
- the resource whose URL is requested.
null
if the resource cannot be found on the class path.
public InputStream getResourceAsStream(String resource)
resource
- the resource whose stream is requested.
null
if the resource cannot be found on the class path. If a stream is returned, the client is responsible to close that stream.
public URL createUrl(String resource) throws IllegalArgumentException
resource
- the resource whose URL is requested.
IllegalArgumentException
- if the URL to the resource cannot be constructed.
public int hashCode()
hashCode
in class
Object
public boolean equals(Object object)
true
if the given object is semantically equal to the given object,
false
otherwise.
equals
in class
Object
object
- the instance to compare to.
true
if the given object is semantically equal to the given object,
false
otherwise.
public String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |