Top Fields Constructors Methods
io.undertow.server.handlers.resource

public Class ClassPathResourceManager

extends Object
implements ResourceManager
Class Inheritance
All Implemented Interfaces
io.undertow.server.handlers.resource.ResourceManager, java.io.Closeable, java.lang.AutoCloseable
Imports
io.undertow.UndertowMessages, java.io.IOException, java.net.URL

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final ClassLoader
classLoader

The class loader that is used to load resources

private final String
prefix

The prefix that is appended to resources that are to be loaded.

Constructor Summary

AccessConstructor and Description
public
public
ClassPathResourceManager(final ClassLoader classLoader, final String prefix)

public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

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

public Resource
getResource(final String
The path
path
)

Implements io.undertow.server.handlers.resource.ResourceManager.getResource.

Returns a resource for the given path.

public boolean
public void
registerResourceChangeListener(ResourceChangeListener
The listener to register
listener
)

Implements io.undertow.server.handlers.resource.ResourceManager.registerResourceChangeListener.

Registers a resource change listener, if the underlying resource manager support it

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderback to summary
private final ClassLoader classLoader

The class loader that is used to load resources

prefixback to summary
private final String prefix

The prefix that is appended to resources that are to be loaded.

Constructor Detail

ClassPathResourceManagerback to summary
public ClassPathResourceManager(final ClassLoader loader, final Package p)
ClassPathResourceManagerback to summary
public ClassPathResourceManager(final ClassLoader classLoader, final String prefix)
ClassPathResourceManagerback to summary
public ClassPathResourceManager(final ClassLoader classLoader)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.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
Exceptions
IOException:
if an I/O error occurs
getResourceback to summary
public Resource getResource(final String path) throws IOException

Implements io.undertow.server.handlers.resource.ResourceManager.getResource.

Doc from io.undertow.server.handlers.resource.ResourceManager.getResource.

Returns a resource for the given path. It is the responsibility of the called to make sure that the path in Canonicalised.

Parameters
path:String

The path

Returns:Resource

The resource representing the path, or null if no resource was found.

Annotations
@Override
isResourceChangeListenerSupportedback to summary
public boolean isResourceChangeListenerSupported()

Implements io.undertow.server.handlers.resource.ResourceManager.isResourceChangeListenerSupported.

Returns:boolean

Doc from io.undertow.server.handlers.resource.ResourceManager.isResourceChangeListenerSupported.

true if a resource change listener is supported

Annotations
@Override
registerResourceChangeListenerback to summary
public void registerResourceChangeListener(ResourceChangeListener listener)

Implements io.undertow.server.handlers.resource.ResourceManager.registerResourceChangeListener.

Doc from io.undertow.server.handlers.resource.ResourceManager.registerResourceChangeListener.

Registers a resource change listener, if the underlying resource manager support it

Parameters
listener:ResourceChangeListener

The listener to register

Annotations
@Override
removeResourceChangeListenerback to summary
public void removeResourceChangeListener(ResourceChangeListener listener)

Implements io.undertow.server.handlers.resource.ResourceManager.removeResourceChangeListener.

Doc from io.undertow.server.handlers.resource.ResourceManager.removeResourceChangeListener.

Removes a resource change listener

Annotations
@Override