Package org.jboss.modules
Class ResourceLoaders
- java.lang.Object
-
- org.jboss.modules.ResourceLoaders
-
public final class ResourceLoaders extends java.lang.Object
Static factory methods for various types of resource loaders.- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static IterableResourceLoader
createFileResourceLoader(java.lang.String name, java.io.File root)
Deprecated.UsecreatePathResourceLoader(Path)
instead.static ResourceLoader
createFileResourceLoader$$bridge(java.lang.String name, java.io.File root)
Deprecated.static IterableResourceLoader
createFilteredResourceLoader(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 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(java.lang.String name, java.io.File root)
Deprecated.UsecreateFileResourceLoader(String, File)
instead.static IterableResourceLoader
createIterableFilteredResourceLoader(PathFilter pathFilter, IterableResourceLoader originalLoader)
Deprecated.UsecreateFileResourceLoader(String, File)
instead.static IterableResourceLoader
createIterableJarResourceLoader(java.lang.String name, java.util.jar.JarFile jarFile)
Deprecated.UsecreateJarResourceLoader(JarFile)
instead.static IterableResourceLoader
createJarResourceLoader(java.lang.String name, java.util.jar.JarFile jarFile)
Deprecated.UsecreateJarResourceLoader(JarFile)
instead.static IterableResourceLoader
createJarResourceLoader(java.lang.String name, java.util.jar.JarFile jarFile, java.lang.String relativePath)
Deprecated.UsecreateJarResourceLoader(JarFile, String)
instead.static IterableResourceLoader
createJarResourceLoader(java.util.jar.JarFile jarFile)
Create a JAR-backed resource loader.static IterableResourceLoader
createJarResourceLoader(java.util.jar.JarFile jarFile, java.lang.String relativePath)
Create a JAR-backed resource loader.static ResourceLoader
createJarResourceLoader$$bridge(java.lang.String name, java.util.jar.JarFile jarFile)
Deprecated.static IterableResourceLoader
createPathResourceLoader(java.lang.String name, java.nio.file.Path path)
Deprecated.UsecreatePathResourceLoader(Path)
instead.static IterableResourceLoader
createPathResourceLoader(java.nio.file.Path path)
Create a NIO2 Path-backed iterable resource loader.static ResourceLoader
createServiceResourceLoader(java.util.Map<java.lang.String,java.util.List<java.lang.String>> serviceMap)
Create a service resource loader.
-
-
-
Method Detail
-
createFileResourceLoader
@Deprecated public static IterableResourceLoader createFileResourceLoader(java.lang.String name, java.io.File root)
Deprecated.UsecreatePathResourceLoader(Path)
instead.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
-
createFileResourceLoader$$bridge
@Deprecated public static ResourceLoader createFileResourceLoader$$bridge(java.lang.String name, java.io.File root)
Deprecated.
-
createIterableFileResourceLoader
@Deprecated public static IterableResourceLoader createIterableFileResourceLoader(java.lang.String name, java.io.File root)
Deprecated.UsecreateFileResourceLoader(String, File)
instead.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
@Deprecated public static IterableResourceLoader createJarResourceLoader(java.lang.String name, java.util.jar.JarFile jarFile)
Deprecated.UsecreateJarResourceLoader(JarFile)
instead.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(java.util.jar.JarFile jarFile)
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:
jarFile
- the backing JAR file- Returns:
- the resource loader
-
createJarResourceLoader$$bridge
@Deprecated public static ResourceLoader createJarResourceLoader$$bridge(java.lang.String name, java.util.jar.JarFile jarFile)
Deprecated.
-
createJarResourceLoader
@Deprecated public static IterableResourceLoader createJarResourceLoader(java.lang.String name, java.util.jar.JarFile jarFile, java.lang.String relativePath)
Deprecated.UsecreateJarResourceLoader(JarFile, String)
instead.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
-
createJarResourceLoader
public static IterableResourceLoader createJarResourceLoader(java.util.jar.JarFile jarFile, java.lang.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:
jarFile
- the backing JAR file- Returns:
- the resource loader
-
createIterableJarResourceLoader
@Deprecated public static IterableResourceLoader createIterableJarResourceLoader(java.lang.String name, java.util.jar.JarFile jarFile)
Deprecated.UsecreateJarResourceLoader(JarFile)
instead.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
-
createFilteredResourceLoader
public static IterableResourceLoader createFilteredResourceLoader(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
-
createIterableFilteredResourceLoader
@Deprecated public static IterableResourceLoader createIterableFilteredResourceLoader(PathFilter pathFilter, IterableResourceLoader originalLoader)
Deprecated.UsecreateFileResourceLoader(String, File)
instead.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
-
createPathResourceLoader
@Deprecated public static IterableResourceLoader createPathResourceLoader(java.lang.String name, java.nio.file.Path path)
Deprecated.UsecreatePathResourceLoader(Path)
instead.Create a NIO2 Path-backed iterable resource loader.- Parameters:
name
- the name of the resource rootpath
- the root path of the resource loader- Returns:
- the resource loader
-
createPathResourceLoader
public static IterableResourceLoader createPathResourceLoader(java.nio.file.Path path)
Create a NIO2 Path-backed iterable resource loader.- Parameters:
path
- the root path of the resource loader- Returns:
- the resource loader
-
createServiceResourceLoader
public static ResourceLoader createServiceResourceLoader(java.util.Map<java.lang.String,java.util.List<java.lang.String>> serviceMap)
Create a service resource loader. This is a resource loader which answers service load requests with a preset implementation name.- Parameters:
serviceMap
- a map of service types to a list of implementation names (must not benull
)- Returns:
- the resource loader (not
null
)
-
-