Package org.jboss.modules
Class ResourceLoaders
java.lang.Object
org.jboss.modules.ResourceLoaders
Static factory methods for various types of resource loaders.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final boolean
(package private) static final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceLoader
createFileResourceLoader
(String name, File root) Create a filesystem-backed resource loader with support for native libraries.static ResourceLoader
createFilteredResourceLoader
(PathFilter pathFilter, ResourceLoader originalLoader) Create a filtered view of a resource loader, which allows classes to be included or excluded on a name basis.static IterableResourceLoader
createIterableFileResourceLoader
(String name, File root) Create a filesystem-backed iterable resource loader with support for native libraries.static IterableResourceLoader
createIterableFilteredResourceLoader
(PathFilter pathFilter, IterableResourceLoader originalLoader) Create a filtered view of an iterable resource loader, which allows classes to be included or excluded on a name basis.static IterableResourceLoader
createIterableJarResourceLoader
(String name, JarFile jarFile) Create a JAR-backed iterable resource loader.static ResourceLoader
createJarResourceLoader
(String name, JarFile jarFile) Create a JAR-backed resource loader.static IterableResourceLoader
createJarResourceLoader
(String name, JarFile jarFile, String relativePath) Create a JAR-backed resource loader.
-
Field Details
-
USE_INDEXES
static final boolean USE_INDEXES -
WRITE_INDEXES
static final boolean WRITE_INDEXES
-
-
Constructor Details
-
ResourceLoaders
private ResourceLoaders()
-
-
Method Details
-
createFileResourceLoader
Create a filesystem-backed resource loader with support for native libraries. Created classes have a code source with afile:
URL.- Parameters:
name
- the name of the resource rootroot
- the root file of the resource loader- Returns:
- the resource loader
-
createIterableFileResourceLoader
Create a filesystem-backed iterable resource loader with support for native libraries. Created classes have a code source with afile:
URL.- Parameters:
name
- the name of the resource rootroot
- the root file of the resource loader- Returns:
- the resource loader
-
createJarResourceLoader
Create a JAR-backed resource loader. JAR resource loaders do not have native library support. Created classes have a code source with ajar:
URL; nested JARs are not supported.- Parameters:
name
- the name of the resource rootjarFile
- the backing JAR file- Returns:
- the resource loader
-
createJarResourceLoader
public static IterableResourceLoader createJarResourceLoader(String name, JarFile jarFile, String relativePath) Create a JAR-backed resource loader. JAR resource loaders do not have native library support. Created classes have a code source with ajar:
URL; nested JARs are not supported. The given relative path within the JAR is used as the root of the loader.- Parameters:
name
- the name of the resource rootjarFile
- the backing JAR file- Returns:
- the resource loader
-
createIterableJarResourceLoader
Create a JAR-backed iterable resource loader. JAR resource loaders do not have native library support. Created classes have a code source with ajar:
URL; nested JARs are not supported.- Parameters:
name
- the name of the resource rootjarFile
- the backing JAR file- Returns:
- the resource loader
-
createFilteredResourceLoader
public static ResourceLoader createFilteredResourceLoader(PathFilter pathFilter, ResourceLoader originalLoader) Create a filtered view of a resource loader, which allows classes to be included or excluded on a name basis. The given filter is matched against the actual class or resource name, not the directory name.- Parameters:
pathFilter
- the path filter to applyoriginalLoader
- the original loader to apply to- Returns:
- the filtered resource loader
-
createIterableFilteredResourceLoader
public static IterableResourceLoader createIterableFilteredResourceLoader(PathFilter pathFilter, IterableResourceLoader originalLoader) Create a filtered view of an iterable resource loader, which allows classes to be included or excluded on a name basis. The given filter is matched against the actual class or resource name, not the directory name.- Parameters:
pathFilter
- the path filter to applyoriginalLoader
- the original loader to apply to- Returns:
- the filtered resource loader
-