Top Description Constructors Methods
org.jboss.modules

public final Class ResourceLoaders

extends Object
Class Inheritance
Imports
java.io.File, java.nio.file.Path, java.security.AccessController, java.util.HashMap, .List, .Map, java.util.jar.JarFile, org.jboss.modules.filter.PathFilter

Static factory methods for various types of resource loaders.
Author
David M. Lloyd

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static IterableResourceLoader

Returns:

the resource loader
createFileResourceLoader
(final String
the name of the resource root
name
,
final File
the root file of the resource loader
root
)

Deprecated Use createPathResourceLoader(Path) instead.
Create a filesystem-backed resource loader with support for native libraries.
public static ResourceLoader
createFileResourceLoader$$bridge(final String name, final File root)

Deprecated
public static ResourceLoader

Returns:

the filtered resource loader
createFilteredResourceLoader
(final PathFilter
the path filter to apply
pathFilter
,
final ResourceLoader
the original loader to apply to
originalLoader
)

Create a filtered view of a resource loader, which allows classes to be included or excluded on a name basis.

public static IterableResourceLoader

Returns:

the filtered resource loader
createFilteredResourceLoader
(final PathFilter
the path filter to apply
pathFilter
,
final IterableResourceLoader
the original loader to apply to
originalLoader
)

Create a filtered view of an iterable resource loader, which allows classes to be included or excluded on a name basis.

public static IterableResourceLoader

Returns:

the resource loader
createIterableFileResourceLoader
(final String
the name of the resource root
name
,
final File
the root file of the resource loader
root
)

Deprecated Use createFileResourceLoader(String, File) instead.
Create a filesystem-backed iterable resource loader with support for native libraries.
public static IterableResourceLoader

Returns:

the filtered resource loader
createIterableFilteredResourceLoader
(final PathFilter
the path filter to apply
pathFilter
,
final IterableResourceLoader
the original loader to apply to
originalLoader
)

Deprecated Use createFileResourceLoader(String, File) instead.
Create a filtered view of an iterable resource loader, which allows classes to be included or excluded on a name basis.
public static IterableResourceLoader

Returns:

the resource loader
createIterableJarResourceLoader
(final String
the name of the resource root
name
,
final JarFile
the backing JAR file
jarFile
)

Deprecated Use createJarResourceLoader(JarFile) instead.
Create a JAR-backed iterable resource loader.
public static IterableResourceLoader

Returns:

the resource loader
createJarResourceLoader
(final String
the name of the resource root
name
,
final JarFile
the backing JAR file
jarFile
)

Deprecated Use createJarResourceLoader(JarFile) instead.
Create a JAR-backed resource loader.
public static IterableResourceLoader

Returns:

the resource loader
createJarResourceLoader
(final JarFile
the backing JAR file
jarFile
)

Create a JAR-backed resource loader.

public static IterableResourceLoader

Returns:

the resource loader
createJarResourceLoader
(final String
the name of the resource root
name
,
final JarFile
the backing JAR file
jarFile
,
final String relativePath)

Create a JAR-backed resource loader.
public static IterableResourceLoader

Returns:

the resource loader
createJarResourceLoader
(final JarFile
the backing JAR file
jarFile
,
final String relativePath)

Create a JAR-backed resource loader.

public static ResourceLoader
createJarResourceLoader$$bridge(final String name, final JarFile jarFile)

Deprecated
public static IterableResourceLoader

Returns:

the resource loader
createPathResourceLoader
(final String
the name of the resource root
name
,
final Path
the root path of the resource loader
path
)

Deprecated Use createPathResourceLoader(Path) instead.
Create a NIO2 Path-backed iterable resource loader.
public static IterableResourceLoader

Returns:

the resource loader
createPathResourceLoader
(final Path
the root path of the resource loader
path
)

Create a NIO2 Path-backed iterable resource loader.

public static ResourceLoader

Returns:

the resource loader (not null)
createServiceResourceLoader
(final Map<String, List<String>>
a map of service types to a list of implementation names (must not be null)
serviceMap
)

Create a service resource loader.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ResourceLoadersback to summary
private ResourceLoaders()

Method Detail

createFileResourceLoaderback to summary
public static IterableResourceLoader createFileResourceLoader(final String name, final File root)

Deprecated

Use createPathResourceLoader(Path) instead.

Create a filesystem-backed resource loader with support for native libraries. Created classes have a code source with a file: URL.

Parameters
name:String

the name of the resource root

root:File

the root file of the resource loader

Returns:IterableResourceLoader

the resource loader

Annotations
@Deprecated
createFileResourceLoader$$bridgeback to summary
public static ResourceLoader createFileResourceLoader$$bridge(final String name, final File root)

Deprecated

Annotations
@Deprecated
createFilteredResourceLoaderback to summary
public static ResourceLoader createFilteredResourceLoader(final PathFilter pathFilter, final 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:PathFilter

the path filter to apply

originalLoader:ResourceLoader

the original loader to apply to

Returns:ResourceLoader

the filtered resource loader

createFilteredResourceLoaderback to summary
public static IterableResourceLoader createFilteredResourceLoader(final PathFilter pathFilter, final 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:PathFilter

the path filter to apply

originalLoader:IterableResourceLoader

the original loader to apply to

Returns:IterableResourceLoader

the filtered resource loader

createIterableFileResourceLoaderback to summary
public static IterableResourceLoader createIterableFileResourceLoader(final String name, final File root)

Create a filesystem-backed iterable resource loader with support for native libraries. Created classes have a code source with a file: URL.

Parameters
name:String

the name of the resource root

root:File

the root file of the resource loader

Returns:IterableResourceLoader

the resource loader

Annotations
@Deprecated
createIterableFilteredResourceLoaderback to summary
public static IterableResourceLoader createIterableFilteredResourceLoader(final PathFilter pathFilter, final 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:PathFilter

the path filter to apply

originalLoader:IterableResourceLoader

the original loader to apply to

Returns:IterableResourceLoader

the filtered resource loader

Annotations
@Deprecated
createIterableJarResourceLoaderback to summary
public static IterableResourceLoader createIterableJarResourceLoader(final String name, final JarFile jarFile)

Deprecated

Use createJarResourceLoader(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 a jar: URL; nested JARs are not supported.

Parameters
name:String

the name of the resource root

jarFile:JarFile

the backing JAR file

Returns:IterableResourceLoader

the resource loader

Annotations
@Deprecated
createJarResourceLoaderback to summary
public static IterableResourceLoader createJarResourceLoader(final String name, final JarFile jarFile)

Deprecated

Use createJarResourceLoader(JarFile) instead.

Create a JAR-backed resource loader. JAR resource loaders do not have native library support. Created classes have a code source with a jar: URL; nested JARs are not supported.

Parameters
name:String

the name of the resource root

jarFile:JarFile

the backing JAR file

Returns:IterableResourceLoader

the resource loader

Annotations
@Deprecated
createJarResourceLoaderback to summary
public static IterableResourceLoader createJarResourceLoader(final JarFile jarFile)

Create a JAR-backed resource loader. JAR resource loaders do not have native library support. Created classes have a code source with a jar: URL; nested JARs are not supported.

Parameters
jarFile:JarFile

the backing JAR file

Returns:IterableResourceLoader

the resource loader

createJarResourceLoaderback to summary
public static IterableResourceLoader createJarResourceLoader(final String name, final JarFile jarFile, final String relativePath)

Create a JAR-backed resource loader. JAR resource loaders do not have native library support. Created classes have a code source with a jar: URL; nested JARs are not supported. The given relative path within the JAR is used as the root of the loader.

Parameters
name:String

the name of the resource root

jarFile:JarFile

the backing JAR file

Returns:IterableResourceLoader

the resource loader

Annotations
@Deprecated
createJarResourceLoaderback to summary
public static IterableResourceLoader createJarResourceLoader(final JarFile jarFile, final String relativePath)

Create a JAR-backed resource loader. JAR resource loaders do not have native library support. Created classes have a code source with a jar: URL; nested JARs are not supported. The given relative path within the JAR is used as the root of the loader.

Parameters
jarFile:JarFile

the backing JAR file

Returns:IterableResourceLoader

the resource loader

createJarResourceLoader$$bridgeback to summary
public static ResourceLoader createJarResourceLoader$$bridge(final String name, final JarFile jarFile)

Deprecated

Annotations
@Deprecated
createPathResourceLoaderback to summary
public static IterableResourceLoader createPathResourceLoader(final String name, final Path path)

Deprecated

Use createPathResourceLoader(Path) instead.

Create a NIO2 Path-backed iterable resource loader.

Parameters
name:String

the name of the resource root

path:Path

the root path of the resource loader

Returns:IterableResourceLoader

the resource loader

Annotations
@Deprecated
createPathResourceLoaderback to summary
public static IterableResourceLoader createPathResourceLoader(final Path path)

Create a NIO2 Path-backed iterable resource loader.

Parameters
path:Path

the root path of the resource loader

Returns:IterableResourceLoader

the resource loader

createServiceResourceLoaderback to summary
public static ResourceLoader createServiceResourceLoader(final Map<String, List<String>> serviceMap)

Create a service resource loader. This is a resource loader which answers service load requests with a preset implementation name.

Parameters
serviceMap:Map<String, List<String>>

a map of service types to a list of implementation names (must not be null)

Returns:ResourceLoader

the resource loader (not null)