AbstractResourceSet (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.catalina.webresources, class: AbstractResourceSet

# 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
Abstract `WebResourceSet` implementation that provides common functionality for all web resource set implementations.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Lifecycle

  `Lifecycle.SingleUse`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final StringManager`
  `sm`
  The string manager for this class.

  ### Fields inherited from interface 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
  Description
  `protected`
  `AbstractResourceSet()`
  Constructs a new AbstractResourceSet.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected final void`
  `checkPath(String path)`
  Checks that the given path is valid.
  `protected final void`
  `destroyInternal()`
  Destroys this resource set.
  `protected final String`
  `getBase()`
  Gets the base.
  `boolean`
  `getClassLoaderOnly()`
  Checks if this resource set is class loader only.
  `protected final String`
  `getInternalPath()`
  Gets the internal path.
  `protected final Manifest`
  `getManifest()`
  Gets the manifest.
  `protected final WebResourceRoot`
  `getRoot()`
  Gets the root.
  `boolean`
  `getStaticOnly()`
  Checks if this resource set is static only.
  `protected final String`
  `getWebAppMount()`
  Gets the web app mount.
  `protected boolean`
  `isPathMounted(String path, String webAppMount)`
  Checks if the given path is mounted at the given web app mount.
  `final void`
  `setBase(String base)`
  Sets the base.
  `void`
  `setClassLoaderOnly(boolean classLoaderOnly)`
  Sets whether this resource set is class loader only.
  `final void`
  `setInternalPath(String internalPath)`
  Sets the internal path.
  `protected final void`
  `setManifest(Manifest manifest)`
  Sets the manifest.
  `final void`
  `setRoot(WebResourceRoot root)`
  Sets the root.
  `void`
  `setStaticOnly(boolean staticOnly)`
  Sets whether this resource set is static only.
  `final void`
  `setWebAppMount(String webAppMount)`
  Sets the web app mount.
  `protected final void`
  `startInternal()`
  Starts this resource set.
  `protected final void`
  `stopInternal()`
  Stops this resource set.

  ### Methods inherited from class LifecycleBase

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

  ### Methods inherited from class Object

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

  ### Methods inherited from interface Lifecycle

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

  ### Methods inherited from interface WebResourceSet

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

- ## Field Details

  - ### sm

    protected static final StringManager sm
    The string manager for this class.

- ## Constructor Details

  - ### AbstractResourceSet

    protected AbstractResourceSet()
    Constructs a new AbstractResourceSet.

- ## Method Details

  - ### checkPath

    protected final void checkPath(String path)
    Checks that the given path is valid.
    Parameters:
      `path` - The path to check
    Throws:
      `IllegalArgumentException` - if the path is invalid

  - ### setRoot

    public final void setRoot(WebResourceRoot root)
    Sets the root.
    Specified by:
      `setRoot` in interface `WebResourceSet`
    Parameters:
      `root` - The root

  - ### getRoot

    protected final WebResourceRoot getRoot()
    Gets the root.
    Returns:
      The root

  - ### getInternalPath

    protected final String getInternalPath()
    Gets the internal path.
    Returns:
      The internal path

  - ### setInternalPath

    public final void setInternalPath(String internalPath)
    Sets the internal path.
    Parameters:
      `internalPath` - The internal path

  - ### setWebAppMount

    public final void setWebAppMount(String webAppMount)
    Sets the web app mount.
    Parameters:
      `webAppMount` - The web app mount

  - ### getWebAppMount

    protected final String getWebAppMount()
    Gets the web app mount.
    Returns:
      The web app mount

  - ### isPathMounted

    protected boolean isPathMounted(String path, String webAppMount)
    Checks if the given path is mounted at the given web app mount.
    Parameters:
      `path` - The path to check
      `webAppMount` - The web app mount
    Returns:
      `true` if the path is mounted

  - ### setBase

    public final void setBase(String base)
    Sets the base.
    Parameters:
      `base` - The base

  - ### getBase

    protected final String getBase()
    Gets the base.
    Returns:
      The base

  - ### getClassLoaderOnly

    public boolean getClassLoaderOnly()
    Checks if this resource set is class loader only.
    Specified by:
      `getClassLoaderOnly` in interface `WebResourceSet`
    Returns:
      `true` if this resource set is class loader only

  - ### setClassLoaderOnly

    public void setClassLoaderOnly(boolean classLoaderOnly)
    Sets whether this resource set is class loader only.
    Specified by:
      `setClassLoaderOnly` in interface `WebResourceSet`
    Parameters:
      `classLoaderOnly` - `true` if this resource set is class loader only

  - ### getStaticOnly

    public boolean getStaticOnly()
    Checks if this resource set is static only.
    Specified by:
      `getStaticOnly` in interface `WebResourceSet`
    Returns:
      `true` if this resource set is static only

  - ### setStaticOnly

    public void setStaticOnly(boolean staticOnly)
    Sets whether this resource set is static only.
    Specified by:
      `setStaticOnly` in interface `WebResourceSet`
    Parameters:
      `staticOnly` - `true` if this resource set is static only

  - ### setManifest

    protected final void setManifest(Manifest manifest)
    Sets the manifest.
    Parameters:
      `manifest` - The manifest

  - ### getManifest

    protected final Manifest getManifest()
    Gets the manifest.
    Returns:
      The manifest

  - ### startInternal

    protected final void startInternal() throws LifecycleException
    Starts this resource set.
    Specified by:
      `startInternal` in class `LifecycleBase`
    Throws:
      `LifecycleException` - if a startup error occurs

  - ### stopInternal

    protected final void stopInternal() throws LifecycleException
    Stops this resource set.
    Specified by:
      `stopInternal` in class `LifecycleBase`
    Throws:
      `LifecycleException` - if a shutdown error occurs

  - ### destroyInternal

    protected final void destroyInternal() throws LifecycleException
    Destroys this resource set.
    Specified by:
      `destroyInternal` in class `LifecycleBase`
    Throws:
      `LifecycleException` - if a destroy error occurs