public class PathResourceManager extends Object implements ResourceManager
Modifier and Type | Class and Description |
---|---|
static class |
PathResourceManager.Builder |
static interface |
PathResourceManager.ETagFunction |
Modifier and Type | Field and Description |
---|---|
protected String |
base |
protected FileSystem |
fileSystem |
EMPTY_RESOURCE_MANAGER
Modifier | Constructor and Description |
---|---|
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) |
Modifier and Type | Method and Description |
---|---|
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) |
protected volatile String base
protected volatile FileSystem fileSystem
public PathResourceManager(Path base)
public PathResourceManager(Path base, long transferMinSize)
public PathResourceManager(Path base, long transferMinSize, boolean caseSensitive)
public PathResourceManager(Path base, long transferMinSize, boolean followLinks, String... safePaths)
protected PathResourceManager(long transferMinSize, boolean caseSensitive, boolean followLinks, String... safePaths)
protected PathResourceManager(long transferMinSize, boolean caseSensitive, boolean followLinks, boolean allowResourceChangeListeners, String... safePaths)
public PathResourceManager(Path base, long transferMinSize, boolean caseSensitive, boolean followLinks, String... safePaths)
public Path getBasePath()
public PathResourceManager setBase(Path base)
public PathResourceManager setBase(File base)
public Resource getResource(String p)
ResourceManager
getResource
in interface ResourceManager
p
- The pathpublic boolean isResourceChangeListenerSupported()
isResourceChangeListenerSupported
in interface ResourceManager
true
if a resource change listener is supportedpublic void registerResourceChangeListener(ResourceChangeListener listener)
ResourceManager
registerResourceChangeListener
in interface ResourceManager
listener
- The listener to registerpublic void removeResourceChangeListener(ResourceChangeListener listener)
ResourceManager
removeResourceChangeListener
in interface ResourceManager
public long getTransferMinSize()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected PathResource getFileResource(Path file, String path, Path symlinkBase, String normalizedFile) throws IOException
IOException
public static PathResourceManager.Builder builder()
Copyright © 2019 JBoss by Red Hat. All rights reserved.