Class AbstractFileResourceSet

    • Field Detail

      • EMPTY_STRING_ARRAY

        protected static final java.lang.String[] EMPTY_STRING_ARRAY
        An empty string array.
    • Constructor Detail

      • AbstractFileResourceSet

        protected AbstractFileResourceSet​(java.lang.String internalPath)
        Constructs a new abstract file resource set.
        Parameters:
        internalPath - The internal path
    • Method Detail

      • getFileBase

        protected final java.io.File getFileBase()
        Returns the file base for this resource set.
        Returns:
        the file base
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
        Description copied from interface: WebResourceSet
        Configures whether or not this set of resources is read-only.
        Parameters:
        readOnly - true if this set of resources should be configured to be read-only
      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: WebResourceSet
        Obtains the current value of the read-only setting for this set of resources.
        Returns:
        true if this set of resources is configured to be read-only, otherwise false
      • setAllowLinking

        public void setAllowLinking​(boolean allowLinking)
        Description copied from interface: WebResourceSet
        Configure if this ResourceSet allows the use of symbolic links.
        Parameters:
        allowLinking - true if symbolic links are allowed.
      • file

        protected final java.io.File file​(java.lang.String name,
                                          boolean mustExist)
        Return a File for the specified resource name.
        Parameters:
        name - Name of the resource
        mustExist - Whether the file must exist
        Returns:
        the file for the specified resource
      • logIgnoredSymlink

        protected void logIgnoredSymlink​(java.lang.String contextPath,
                                         java.lang.String absPath,
                                         java.lang.String canPath)
        Logs a message about an ignored symlink.
        Parameters:
        contextPath - The context path
        absPath - The absolute path
        canPath - The canonical path
      • getBaseUrl

        public java.net.URL getBaseUrl()
        Description copied from interface: WebResourceSet
        Obtain the base URL for this set of resources. One of the uses of this is to grant read permissions to the resources when running under a security manager.
        Returns:
        The base URL for this set of resources
      • gc

        public void gc()
        Implementations may cache some information to improve performance. This method triggers the clean-up of those resources.

        This is a NO-OP by default for File based resource sets.

      • checkType

        protected abstract void checkType​(java.io.File file)
        Checks the type of the specified file.
        Parameters:
        file - The file to check
        Throws:
        java.lang.IllegalArgumentException - if the file is not of the expected type