public class PackageResources extends Object
Constructor and Description |
---|
PackageResources(String packageToFind,
ClassLoader classLoader)
Constructor, finds the resources for a certain package.
|
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getAllResourcesEndingWith(String suffix,
boolean recurse)
Returns all resource names in the package ending with the defined suffix.
|
List<File> |
getDirectories()
Returns all directories containing the desired package.
|
List<JarFile> |
getJarFiles()
Returns all jar files containing the desired package.
|
boolean |
isEmpty()
Returns whether the queried package exists in the class path.
|
public PackageResources(String packageToFind, ClassLoader classLoader) throws ConfigurationException
packageToFind
- the path to the package, using / or \\ as path
separator.classLoader
- the class loader to use.ConfigurationException
- when accessing the class path fails.public List<JarFile> getJarFiles()
public List<File> getDirectories()
public boolean isEmpty()
public Collection<String> getAllResourcesEndingWith(String suffix, boolean recurse)
suffix
- the suffix which the resource name must have,
or null to match every file name.recurse
- true if subpackages should also be searched,
false if only the specified package should be searched.Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.