Class PathResourceManager

  • All Implemented Interfaces:
    ResourceManager, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    FileResourceManager

    public class PathResourceManager
    extends java.lang.Object
    implements ResourceManager
    Serves files from the file system.
    • Field Detail

      • base

        protected volatile java.lang.String base
      • fileSystem

        protected volatile java.nio.file.FileSystem fileSystem
    • Constructor Detail

      • PathResourceManager

        public PathResourceManager​(java.nio.file.Path base)
      • PathResourceManager

        public PathResourceManager​(java.nio.file.Path base,
                                   long transferMinSize)
      • PathResourceManager

        public PathResourceManager​(java.nio.file.Path base,
                                   long transferMinSize,
                                   boolean caseSensitive)
      • PathResourceManager

        public PathResourceManager​(java.nio.file.Path base,
                                   long transferMinSize,
                                   boolean followLinks,
                                   java.lang.String... safePaths)
      • PathResourceManager

        protected PathResourceManager​(long transferMinSize,
                                      boolean caseSensitive,
                                      boolean followLinks,
                                      java.lang.String... safePaths)
      • PathResourceManager

        protected PathResourceManager​(long transferMinSize,
                                      boolean caseSensitive,
                                      boolean followLinks,
                                      boolean allowResourceChangeListeners,
                                      java.lang.String... safePaths)
      • PathResourceManager

        public PathResourceManager​(java.nio.file.Path base,
                                   long transferMinSize,
                                   boolean caseSensitive,
                                   boolean followLinks,
                                   java.lang.String... safePaths)
      • PathResourceManager

        public PathResourceManager​(java.nio.file.Path base,
                                   long transferMinSize,
                                   boolean caseSensitive,
                                   boolean followLinks,
                                   boolean allowResourceChangeListeners,
                                   java.lang.String... safePaths)
    • Method Detail

      • getBasePath

        public java.nio.file.Path getBasePath()
      • getResource

        public Resource getResource​(java.lang.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.
      • getTransferMinSize

        public long getTransferMinSize()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • getFileResource

        protected PathResource getFileResource​(java.nio.file.Path file,
                                               java.lang.String path,
                                               java.nio.file.Path symlinkBase,
                                               java.lang.String normalizedFile)
                                        throws java.io.IOException
        Apply security check for case insensitive file systems.
        Throws:
        java.io.IOException