AbstractResourceSet (Apache Tomcat 8.5.57 API Documentation)

org.apache.catalina.webresources

## Class AbstractResourceSet

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

- All Implemented Interfaces:
    Lifecycle, WebResourceSet
  Direct Known Subclasses:
    AbstractArchiveResourceSet, AbstractFileResourceSet

      public abstract class AbstractResourceSet
      extends LifecycleBase
      implements WebResourceSet

- - ### 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 StringManager` | `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
    Constructor and Description
    `AbstractResourceSet()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkPath(String path)`
    `protected void` | `destroyInternal()` Sub-classes implement this method to perform any instance destruction required.
    `protected String` | `getBase()`
    `boolean` | `getClassLoaderOnly()` Should resources returned by this resource set only be included in any results when the lookup is explicitly looking for class loader resources.
    `protected String` | `getInternalPath()`
    `protected Manifest` | `getManifest()`
    `protected WebResourceRoot` | `getRoot()`
    `boolean` | `getStaticOnly()` Should resources returned by this resource set only be included in any results when the lookup is explicitly looking for static (non-class loader) resources. i.e. should these resources be excluded from look ups that are explicitly looking for class loader resources.
    `protected String` | `getWebAppMount()`
    `void` | `setBase(String base)`
    `void` | `setClassLoaderOnly(boolean classLoaderOnly)`
    `void` | `setInternalPath(String internalPath)`
    `protected void` | `setManifest(Manifest manifest)`
    `void` | `setRoot(WebResourceRoot root)`
    `void` | `setStaticOnly(boolean staticOnly)`
    `void` | `setWebAppMount(String webAppMount)`
    `protected void` | `startInternal()` Sub-classes must ensure that the state is changed to `LifecycleState.STARTING` during the execution of this method.
    `protected void` | `stopInternal()` Sub-classes must ensure that the state is changed to `LifecycleState.STOPPING` during the execution of this method.

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

      `addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, initInternal, 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

      `gc, getBaseUrl, getResource, isReadOnly, list, listWebAppPaths, mkdir, setReadOnly, write`

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

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

- - ### Field Detail

    - #### sm

          protected static final StringManager sm

  - ### Constructor Detail

    - #### AbstractResourceSet

          public AbstractResourceSet()

  - ### Method Detail

    - #### checkPath

          protected final void checkPath(String path)

    - #### setRoot

          public final void setRoot(WebResourceRoot root)

      Specified by:
        `setRoot` in interface `WebResourceSet`

    - #### getRoot

          protected final WebResourceRoot getRoot()

    - #### getInternalPath

          protected final String getInternalPath()

    - #### setInternalPath

          public final void setInternalPath(String internalPath)

    - #### setWebAppMount

          public final void setWebAppMount(String webAppMount)

    - #### getWebAppMount

          protected final String getWebAppMount()

    - #### setBase

          public final void setBase(String base)

    - #### getBase

          protected final String getBase()

    - #### getClassLoaderOnly

          public boolean getClassLoaderOnly()

      Description copied from interface: `WebResourceSet`
      Should resources returned by this resource set only be included in any results when the lookup is explicitly looking for class loader resources. i.e. should these resources be excluded from look ups that are explicitly looking for static (non-class loader) resources.
      Specified by:
        `getClassLoaderOnly` in interface `WebResourceSet`
      Returns:
        `true` if these resources should only be used for class loader resource lookups, otherwise `false`

    - #### setClassLoaderOnly

          public void setClassLoaderOnly(boolean classLoaderOnly)

      Specified by:
        `setClassLoaderOnly` in interface `WebResourceSet`

    - #### getStaticOnly

          public boolean getStaticOnly()

      Description copied from interface: `WebResourceSet`
      Should resources returned by this resource set only be included in any results when the lookup is explicitly looking for static (non-class loader) resources. i.e. should these resources be excluded from look ups that are explicitly looking for class loader resources.
      Specified by:
        `getStaticOnly` in interface `WebResourceSet`
      Returns:
        `true` if these resources should only be used for static (non-class loader) resource lookups, otherwise `false`

    - #### setStaticOnly

          public void setStaticOnly(boolean staticOnly)

      Specified by:
        `setStaticOnly` in interface `WebResourceSet`

    - #### setManifest

          protected final void setManifest(Manifest manifest)

    - #### getManifest

          protected final Manifest getManifest()

    - #### startInternal

          protected final void startInternal()
                                      throws LifecycleException

      Description copied from class: `LifecycleBase`
      Sub-classes must ensure that the state is changed to `LifecycleState.STARTING` during the execution of this method. Changing state will trigger the `Lifecycle.START_EVENT` event. If a component fails to start it may either throw a `LifecycleException` which will cause it's parent to fail to start or it can place itself in the error state in which case `LifecycleBase.stop()` will be called on the failed component but the parent component will continue to start normally.
      Specified by:
        `startInternal` in class `LifecycleBase`
      Throws:
        `LifecycleException` - Start error occurred

    - #### stopInternal

          protected final void stopInternal()
                                     throws LifecycleException

      Description copied from class: `LifecycleBase`
      Sub-classes must ensure that the state is changed to `LifecycleState.STOPPING` during the execution of this method. Changing state will trigger the `Lifecycle.STOP_EVENT` event.
      Specified by:
        `stopInternal` in class `LifecycleBase`
      Throws:
        `LifecycleException` - Stop error occurred

    - #### destroyInternal

          protected final void destroyInternal()
                                        throws LifecycleException

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

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