io.undertow.server.handlers.resource

## Class PathResourceManager

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

All Implemented Interfaces:
  ResourceManager, Closeable, AutoCloseable

Direct Known Subclasses:
  FileResourceManager

    public class PathResourceManager
    extends Object
    implements ResourceManager

Serves files from the file system.

### Nested Class Summary

Nested Classes
`static class` `PathResourceManager.Builder`
`static interface` `PathResourceManager.ETagFunction`

### Field Summary

Fields
`protected String` `base`
`protected FileSystem` `fileSystem`

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

`EMPTY_RESOURCE_MANAGER`

### Constructor Summary

Constructors
`protected` `PathResourceManager(long transferMinSize, boolean caseSensitive, boolean followLinks, boolean allowResourceChangeListeners, String... safePaths)`
`protected` `PathResourceManager(long transferMinSize, boolean caseSensitive, boolean followLinks, String... safePaths)`
`` `PathResourceManager(Path base)`
`` `PathResourceManager(Path base, long transferMinSize)`
`` `PathResourceManager(Path base, long transferMinSize, boolean caseSensitive)`
`` `PathResourceManager(Path base, long transferMinSize, boolean caseSensitive, boolean followLinks, boolean allowResourceChangeListeners, String... safePaths)`
`` `PathResourceManager(Path base, long transferMinSize, boolean caseSensitive, boolean followLinks, String... safePaths)`
`` `PathResourceManager(Path base, long transferMinSize, boolean followLinks, String... safePaths)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static PathResourceManager.Builder` `builder()`
`void` `close()`
`Path` `getBasePath()`
`protected PathResource` `getFileResource(Path file, String path, Path symlinkBase, String normalizedFile)` Apply security check for case insensitive file systems.
`Resource` `getResource(String p)` Returns a resource for the given path.
`long` `getTransferMinSize()`
`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
`PathResourceManager` `setBase(File base)`
`PathResourceManager` `setBase(Path base)`

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

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

### Field Detail

#### base

    protected volatile String base

#### fileSystem

    protected volatile FileSystem fileSystem

### Constructor Detail

#### PathResourceManager

    public PathResourceManager(Path base)

#### PathResourceManager

    public PathResourceManager(Path base,
                               long transferMinSize)

#### PathResourceManager

    public PathResourceManager(Path base,
                               long transferMinSize,
                               boolean caseSensitive)

#### PathResourceManager

    public PathResourceManager(Path base,
                               long transferMinSize,
                               boolean followLinks,
                               String... safePaths)

#### PathResourceManager

    protected PathResourceManager(long transferMinSize,
                                  boolean caseSensitive,
                                  boolean followLinks,
                                  String... safePaths)

#### PathResourceManager

    protected PathResourceManager(long transferMinSize,
                                  boolean caseSensitive,
                                  boolean followLinks,
                                  boolean allowResourceChangeListeners,
                                  String... safePaths)

#### PathResourceManager

    public PathResourceManager(Path base,
                               long transferMinSize,
                               boolean caseSensitive,
                               boolean followLinks,
                               String... safePaths)

#### PathResourceManager

    public PathResourceManager(Path base,
                               long transferMinSize,
                               boolean caseSensitive,
                               boolean followLinks,
                               boolean allowResourceChangeListeners,
                               String... safePaths)

### Method Detail

#### getBasePath

    public Path getBasePath()

#### setBase

    public PathResourceManager setBase(Path base)

#### setBase

    public PathResourceManager setBase(File base)

#### getResource

    public Resource getResource(String p)

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:
  `p` - The path
Returns:
  The resource representing the path, or null if no resource was found.

#### 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`

#### getTransferMinSize

    public long getTransferMinSize()

#### close

    public void close()
               throws IOException

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

#### getFileResource

    protected PathResource getFileResource(Path file,
                                           String path,
                                           Path symlinkBase,
                                           String normalizedFile)
                                    throws IOException

Apply security check for case insensitive file systems.

Throws:
  `IOException`

#### builder

    public static PathResourceManager.Builder builder()