|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.util.lang.classpath.ClassPathDirectoryListing
public class ClassPathDirectoryListing
Lists the content of a directory on the class path.
Currently only the protocols
file
) andjar
)are supported.
Constructor Summary | |
---|---|
ClassPathDirectoryListing(ClassLoader classLoader) Default constructor. |
|
ClassPathDirectoryListing(ClassPathContext context) Default constructor. |
Method Summary | |
---|---|
ClassPathContext |
getClassPathContext() Returns the context to load the directory listings. |
List<String> |
list(String resourcePath) Lists the contents of the resource path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassPathDirectoryListing(ClassLoader classLoader) throws NullPointerException
classLoader
- the class loader to load the directory listings.
NullPointerException
- if
classLoader
is
null
.
public ClassPathDirectoryListing(ClassPathContext context) throws NullPointerException
context
- the context to load the directory listings.
NullPointerException
- if
classLoader
is
null
.
Method Detail |
---|
public final ClassPathContext getClassPathContext()
public List<String> list(String resourcePath) throws NullPointerException, IllegalArgumentException
resourcePath
- the path to the resource whose contents is to be listed. The empty string returns the contents of the class loader's root directory (which is usually the parent class loader's root).
null
.
NullPointerException
- if
resourcePath
is
null
.
IllegalArgumentException
- if resource path cannot be resolved to determine the contents. Either the protocol is unknown or there is a problem to access the resource's content physically.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |