de.smartics.util.lang.classpath
Class JarAndFileClassPathListing

java.lang.Object
  extended by de.smartics.util.lang.classpath.JarAndFileClassPathListing
All Implemented Interfaces:
ClassPathListing

public final class JarAndFileClassPathListing
     
     
extends Object
implements ClassPathListing

Supports listing of class path elements for protocols jar and file.


Constructor Summary
JarAndFileClassPathListing()
           
 
Method Summary
 List<String> list(ClassPathContext context, 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

JarAndFileClassPathListing

public JarAndFileClassPathListing()
Method Detail

list

public List<String> list(ClassPathContext context,
                         String resourcePath)
                  throws NullPointerException,
                         IllegalArgumentException
Description copied from interface: ClassPathListing
Lists the contents of the resource path.

Specified by:
list in interface ClassPathListing
Parameters:
context - the context to load the resource from the class path.
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).
Returns:
the contents of the resource as names. The list may be empty, but is never null.
Throws:
NullPointerException - if context or 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.


Copyright © 2011–2013 smartics. All rights reserved.