Class MountedPathResourceFactory
java.lang.Object
org.eclipse.jetty.util.resource.MountedPathResourceFactory
- All Implemented Interfaces:
ResourceFactory
@ManagedObject("Factory for Mounted Resources")
public class MountedPathResourceFactory
extends Object
implements ResourceFactory
A ResourceFactory for mounted FileSystems.
Example, for the "jar" scheme, this would use the JDK built-in ZipFileSystemProvider to load JAR files
as a FileSystem suitable for PathResource.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ResourceFactory
ResourceFactory.Closeable, ResourceFactory.LifeCycle -
Field Summary
Fields inherited from interface ResourceFactory
LOG -
Constructor Summary
ConstructorsConstructorDescriptionMountedPathResourceFactory(FileSystem fileSystem) Pre-initialize aMountedPathResourceFactorywith a known FileSystem that must always be used. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceFactory
asResource, newClassLoaderResource, newClassLoaderResource, newClassPathResource, newJarFileResource, newMemoryResource, newResource, newResource, newResource, newResource, newSystemResource, split, split, split, split
-
Constructor Details
-
MountedPathResourceFactory
public MountedPathResourceFactory() -
MountedPathResourceFactory
Pre-initialize aMountedPathResourceFactorywith a known FileSystem that must always be used.- Parameters:
fileSystem- if not null, use the providedFileSystemwhen calls tonewResource(URI)is used. if null, then the JDKFileSystems.newFileSystem(URI, Map)API is used for allnewResource(URI)calls.
-
-
Method Details
-
newResource
Description copied from interface:ResourceFactoryConstruct a resource from a URI.Each call may allocate a new JVM resource, whose lifecycle is tied to this ResourceFactory implementation.
This method is used to create root (or base) resources. Child resources of these resources, should be created using
Resource.resolve(String)- Specified by:
newResourcein interfaceResourceFactory- Parameters:
uri- A URI.- Returns:
- A Resource object.
-