public final class ResourceList extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FALLBACK_RESOURCES_LIST_PATH |
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
getResources(ClassLoader cl,
URL url,
String resourcePath,
Pattern resourcePattern)
Gets a collection of resources from an url
|
static String[] |
getResourcesArray(ClassLoader cl,
URLResolver urlResolver,
String resourcePath,
Pattern resourcePattern)
For all non-class elements of java classpath with path resourcePath, gets a
Collection of resources with pattern resourcePattern
|
static List<String> |
getResourcesFromDirectory(File directory,
Pattern resourcePattern,
int classpathRootLength) |
static List<String> |
getResourcesFromDirectory(File directory,
String resourcePath,
Pattern resourcePattern)
Gets resources recursively from directory
|
static List<String> |
getResourcesFromJarFile(File file,
String resourcePath,
Pattern resourcePattern)
gets resources from jar file
The resources paths match resourcePath and files names resourcePattern |
static List<String> |
getResourcesList(ClassLoader cl,
URLResolver urlResolver,
String resourcePath,
Pattern resourcePattern)
for all elements of java.class.path get a list of resources Pattern
pattern = Pattern.compile(".*"); gets all resources |
public static String FALLBACK_RESOURCES_LIST_PATH
public static String[] getResourcesArray(ClassLoader cl, URLResolver urlResolver, String resourcePath, Pattern resourcePattern) throws IOException, URISyntaxException
cl - the class loader to useurlResolver - the url resolver needed to transform classpath URL to
native java classpath library, in non classic
environments such as OSGI resourcePath - the parent path of resources in classpathresourcePattern - the pattern that must match file names of resourcesIOException - if an error occurs during the resolutionURISyntaxException - if url is not well formattedURLResolverpublic static List<String> getResourcesList(ClassLoader cl, URLResolver urlResolver, String resourcePath, Pattern resourcePattern) throws IOException, URISyntaxException
cl - the class loader to useurlResolver - the url resolver needed to transform classpath URL to
native java classpath library, in non classic
environments such as OSGI resourcePath - the parent path of resources in classpathresourcePattern - the pattern that must match file names of resourcesIOException - if an error occurs during the resolutionURISyntaxException - if a classpath url is not well formattedURLResolverpublic static List<String> getResources(ClassLoader cl, URL url, String resourcePath, Pattern resourcePattern) throws URISyntaxException, IOException
cl - the class loader to useurl - url of classpath resourceresourcePath - the parent path of resources in classpathresourcePattern - the pattern that must match file names of resourcesURISyntaxException - if url is not well formattedIOException - if an error occurs during the resolutionpublic static List<String> getResourcesFromJarFile(File file, String resourcePath, Pattern resourcePattern) throws IOException
file - jar fileresourcePath - the parent path of resources in classpathresourcePattern - the pattern that must match file names of resourcesIOException - if an error occurs during the resolutionpublic static List<String> getResourcesFromDirectory(File directory, String resourcePath, Pattern resourcePattern) throws IOException
directory - the directory where to look forresourcePath - the parent path of resources in classpathresourcePattern - the pattern that must match file names of resourcesIOException - if an error occurs during the resolutionpublic static List<String> getResourcesFromDirectory(File directory, Pattern resourcePattern, int classpathRootLength) throws IOException
IOExceptionCopyright © 2025 CNES. All rights reserved.