Top Inners Fields Constructors Methods
org.eclipse.jetty.util.resource

pack-priv Class ResourceFactoryInternals

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.URI, .URISyntaxException, .URL, java.nio.file.Path, .ProviderNotFoundException, java.util.List, java.util.concurrent.CopyOnWriteArrayList, org.eclipse.jetty.util.IO, .Index, .StringUtil, .URIUtil, org.eclipse.jetty.util.component.AbstractLifeCycle, .Dumpable, .DumpableCollection, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private static final Path
private static final Logger
pack-priv static final Index.Mutable<ResourceFactory>
RESOURCE_FACTORIES

The Index (Map) of URI schemes to ResourceFactory implementations that is used by CompositeResourceFactory

pack-priv static ResourceFactory

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static boolean

Returns:

true if a ResourceFactory is registered to support the uri
isSupported
(URI
the uri to test
uri
)

Test uri to know if a ResourceFactory is registered for it.

pack-priv static boolean

Returns:

true if a ResourceFactory is registered to support the string representation
isSupported
(String
the string representing the resource location
str
)

Test string to know if a ResourceFactory is registered for it.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CURRENT_WORKING_DIRback to summary
private static final Path CURRENT_WORKING_DIR
LOGback to summary
private static final Logger LOG
RESOURCE_FACTORIESback to summary
pack-priv static final Index.Mutable<ResourceFactory> RESOURCE_FACTORIES

The Index (Map) of URI schemes to ResourceFactory implementations that is used by CompositeResourceFactory

ROOTback to summary
pack-priv static ResourceFactory ROOT

Constructor Detail

ResourceFactoryInternalsback to summary
pack-priv ResourceFactoryInternals()

Method Detail

isSupportedback to summary
pack-priv static boolean isSupported(URI uri)

Test uri to know if a ResourceFactory is registered for it.

Parameters
uri:URI

the uri to test

Returns:boolean

true if a ResourceFactory is registered to support the uri

See Also
ResourceFactory#registerResourceFactory(String, ResourceFactory), ResourceFactory#unregisterResourceFactory(String), isSupported(String)
isSupportedback to summary
pack-priv static boolean isSupported(String str)

Test string to know if a ResourceFactory is registered for it.

Parameters
str:String

the string representing the resource location

Returns:boolean

true if a ResourceFactory is registered to support the string representation

See Also
org.eclipse.jetty.util.Index#getBest(String), ResourceFactory#registerResourceFactory(String, ResourceFactory), ResourceFactory#unregisterResourceFactory(String), isSupported(URI)
org.eclipse.jetty.util.resource back to summary

pack-priv Class ResourceFactoryInternals.Closeable

extends Object
implements Closeable, Tracking
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.util.resource.ResourceFactoryInternals.Closeable
All Implemented Interfaces
org.eclipse.jetty.util.resource.ResourceFactoryInternals.Tracking, org.eclipse.jetty.util.resource.ResourceFactory.Closeable, java.io.Closeable, java.lang.AutoCloseable, org.eclipse.jetty.util.resource.ResourceFactory

Field Summary

Modifier and TypeField and Description
private final ResourceFactoryInternals.CompositeResourceFactory
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.eclipse.jetty.util.resource.ResourceFactory.Closeable.close.

Closes this stream and releases any system resources associated with it.

public int
public Resource
newResource(URI
A URI.
uri
)

Implements org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Construct a resource from a uri.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_compositeResourceFactoryback to summary
private final ResourceFactoryInternals.CompositeResourceFactory _compositeResourceFactory
closedback to summary
private boolean closed

Constructor Detail

Closeableback to summary
pack-priv Closeable()

Method Detail

closeback to summary
public void close()

Implements org.eclipse.jetty.util.resource.ResourceFactory.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
getTrackingCountback to summary
public int getTrackingCount()

Implements org.eclipse.jetty.util.resource.ResourceFactoryInternals.Tracking.getTrackingCount.

newResourceback to summary
public Resource newResource(URI uri)

Implements org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Doc from org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Construct a resource from a uri.

Parameters
uri:URI

A URI.

Returns:Resource

A Resource object, or null if uri points to a location that does not exist.

Annotations
@Override
org.eclipse.jetty.util.resource back to summary

pack-priv Class ResourceFactoryInternals.CompositeResourceFactory

extends Object
implements ResourceFactory
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.util.resource.ResourceFactoryInternals.CompositeResourceFactory
All Implemented Interfaces
org.eclipse.jetty.util.resource.ResourceFactory

Field Summary

Modifier and TypeField and Description
private final List<FileSystemPool.Mount>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public List<FileSystemPool.Mount>
private FileSystemPool.Mount

Returns:

A reference counted FileSystemPool.Mount for that file system or null. Callers should call FileSystemPool.Mount#close() once they no longer require this specific Mount.
mountIfNeeded
(URI
The URI to mount that may require a FileSystem (e.g. "jar:file://tmp/some.jar!/directory/file.txt")
uri
)

Mount a URI if it is needed.

public Resource
newResource(URI
A URI.
uri
)

Implements org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Construct a resource from a uri.

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_mountsback to summary
private final List<FileSystemPool.Mount> _mounts

Constructor Detail

CompositeResourceFactoryback to summary
pack-priv CompositeResourceFactory()

Method Detail

clearMountsback to summary
public void clearMounts()
getMountsback to summary
public List<FileSystemPool.Mount> getMounts()
mountIfNeededback to summary
private FileSystemPool.Mount mountIfNeeded(URI uri)

Mount a URI if it is needed.

Parameters
uri:URI

The URI to mount that may require a FileSystem (e.g. "jar:file://tmp/some.jar!/directory/file.txt")

Returns:FileSystemPool.Mount

A reference counted FileSystemPool.Mount for that file system or null. Callers should call FileSystemPool.Mount#close() once they no longer require this specific Mount.

Exceptions
IllegalArgumentException:
If the uri could not be mounted.
newResourceback to summary
public Resource newResource(URI uri)

Implements org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Doc from org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Construct a resource from a uri.

Parameters
uri:URI

A URI.

Returns:Resource

A Resource object, or null if uri points to a location that does not exist.

Annotations
@Override
onMountedback to summary
protected void onMounted(FileSystemPool.Mount mount, URI uri)
org.eclipse.jetty.util.resource back to summary

pack-priv Class ResourceFactoryInternals.LifeCycle

extends AbstractLifeCycle
implements LifeCycle
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.resource.ResourceFactory.LifeCycle, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.resource.ResourceFactory, org.eclipse.jetty.util.component.LifeCycle

Field Summary

Modifier and TypeField and Description
private final ResourceFactoryInternals.CompositeResourceFactory
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
FAILEDSTARTEDSTARTINGSTOPPEDSTOPPING

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
doStop()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public Resource
newResource(URI
A URI.
uri
)

Implements org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Construct a resource from a uri.

Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
addEventListenerdoStartgetEventListenersgetStategetStateisFailedisRunningisStartedisStartingisStoppedisStoppingremoveEventListenersetEventListenersstartstoptoString

Field Detail

_compositeResourceFactoryback to summary
private final ResourceFactoryInternals.CompositeResourceFactory _compositeResourceFactory

Constructor Detail

LifeCycleback to summary
pack-priv LifeCycle()

Method Detail

doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
newResourceback to summary
public Resource newResource(URI uri)

Implements org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Doc from org.eclipse.jetty.util.resource.ResourceFactory.newResource.

Construct a resource from a uri.

Parameters
uri:URI

A URI.

Returns:Resource

A Resource object, or null if uri points to a location that does not exist.

Annotations
@Override
org.eclipse.jetty.util.resource back to summary

pack-priv Interface ResourceFactoryInternals.Tracking

Known Direct Implementers
org.eclipse.jetty.util.resource.ResourceFactoryInternals.Closeable

Method Summary

Modifier and TypeMethod and Description
public int

Method Detail

getTrackingCountback to summary
public int getTrackingCount()