AbstractFileResourceSet (Apache Tomcat 8.5.57 API Documentation)

org.apache.catalina.webresources

## Class AbstractFileResourceSet

- java.lang.Object
- - org.apache.catalina.util.LifecycleBase
  - - org.apache.catalina.webresources.AbstractResourceSet
    - - org.apache.catalina.webresources.AbstractFileResourceSet

- All Implemented Interfaces:
    Lifecycle, WebResourceSet
  Direct Known Subclasses:
    DirResourceSet, FileResourceSet

      public abstract class AbstractFileResourceSet
      extends AbstractResourceSet

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

      `Lifecycle.SingleUse`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String[]` | `EMPTY_STRING_ARRAY`

    - ### Fields inherited from class org.apache.catalina.webresources.AbstractResourceSet

      `sm`

    - ### Fields inherited from interface org.apache.catalina.Lifecycle

      `AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractFileResourceSet(String internalPath)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `checkType(File file)`
    `protected File` | `file(String name, boolean mustExist)`
    `void` | `gc()` Implementations may cache some information to improve performance.
    `URL` | `getBaseUrl()` Obtain the base URL for this set of resources.
    `protected File` | `getFileBase()`
    `protected void` | `initInternal()` Sub-classes implement this method to perform any instance initialisation required.
    `boolean` | `isReadOnly()` Obtains the current value of the read-only setting for this set of resources.
    `void` | `setReadOnly(boolean readOnly)` Configures whether or not this set of resources is read-only.

    - ### Methods inherited from class org.apache.catalina.webresources.AbstractResourceSet

      `checkPath, destroyInternal, getBase, getClassLoaderOnly, getInternalPath, getManifest, getRoot, getStaticOnly, getWebAppMount, setBase, setClassLoaderOnly, setInternalPath, setManifest, setRoot, setStaticOnly, setWebAppMount, startInternal, stopInternal`

    - ### Methods inherited from class org.apache.catalina.util.LifecycleBase

      `addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop`

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

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

    - ### Methods inherited from interface org.apache.catalina.WebResourceSet

      `getResource, list, listWebAppPaths, mkdir, write`

    - ### Methods inherited from interface org.apache.catalina.Lifecycle

      `addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop`

- - ### Field Detail

    - #### EMPTY_STRING_ARRAY

          protected static final String[] EMPTY_STRING_ARRAY

  - ### Constructor Detail

    - #### AbstractFileResourceSet

          protected AbstractFileResourceSet(String internalPath)

  - ### Method Detail

    - #### getFileBase

          protected final File getFileBase()

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

    - #### file

          protected final File file(String name,
                  boolean mustExist)

    - #### getBaseUrl

          public 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.

    - #### initInternal

          protected void initInternal()
                               throws LifecycleException

      Description copied from class: `LifecycleBase`
      Sub-classes implement this method to perform any instance initialisation required.
      Specified by:
        `initInternal` in class `LifecycleBase`
      Throws:
        `LifecycleException` - If the initialisation fails

    - #### checkType

          protected abstract void checkType(File file)

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.