io.undertow.server.handlers.resource

## Class ClassPathResourceManager

- java.lang.Object
- - io.undertow.server.handlers.resource.ClassPathResourceManager

All Implemented Interfaces:
  ResourceManager, Closeable, AutoCloseable

    public class ClassPathResourceManager
    extends Object
    implements ResourceManager

Author:
  Stuart Douglas

### Field Summary

### Fields inherited from interface io.undertow.server.handlers.resource.ResourceManager

`EMPTY_RESOURCE_MANAGER`

### Constructor Summary

Constructors
Constructor and Description
`ClassPathResourceManager(ClassLoader classLoader)`
`ClassPathResourceManager(ClassLoader loader, Package p)`
`ClassPathResourceManager(ClassLoader classLoader, String prefix)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`Resource` `getResource(String path)` Returns a resource for the given path.
`boolean` `isResourceChangeListenerSupported()`
`void` `registerResourceChangeListener(ResourceChangeListener listener)` Registers a resource change listener, if the underlying resource manager support it
`void` `removeResourceChangeListener(ResourceChangeListener listener)` Removes a resource change listener

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ClassPathResourceManager

    public ClassPathResourceManager(ClassLoader loader,
                                    Package p)

#### ClassPathResourceManager

    public ClassPathResourceManager(ClassLoader classLoader,
                                    String prefix)

#### ClassPathResourceManager

    public ClassPathResourceManager(ClassLoader classLoader)

### Method Detail

#### getResource

    public Resource getResource(String path)
                         throws IOException

Description copied from interface: `ResourceManager`
Returns a resource for the given path. It is the responsibility of the called to make sure that the path in Canonicalised.

Specified by:
  `getResource` in interface `ResourceManager`
Parameters:
  `path` - The path
Returns:
  The resource representing the path, or null if no resource was found.
Throws:
  `IOException`

#### isResourceChangeListenerSupported

    public boolean isResourceChangeListenerSupported()

Specified by:
  `isResourceChangeListenerSupported` in interface `ResourceManager`
Returns:
  `true` if a resource change listener is supported

#### registerResourceChangeListener

    public void registerResourceChangeListener(ResourceChangeListener listener)

Description copied from interface: `ResourceManager`
Registers a resource change listener, if the underlying resource manager support it

Specified by:
  `registerResourceChangeListener` in interface `ResourceManager`
Parameters:
  `listener` - The listener to register

#### removeResourceChangeListener

    public void removeResourceChangeListener(ResourceChangeListener listener)

Description copied from interface: `ResourceManager`
Removes a resource change listener

Specified by:
  `removeResourceChangeListener` in interface `ResourceManager`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Throws:
  `IOException`