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

# Class WarResourceSet

java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.webresources.AbstractResourceSet
org.apache.catalina.webresources.AbstractArchiveResourceSet
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet
org.apache.catalina.webresources.WarResourceSet

All Implemented Interfaces:
  `Lifecycle, WebResourceSet`

public class WarResourceSet extends AbstractSingleArchiveResourceSet
Represents a `WebResourceSet` based on a WAR file.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Lifecycle

  `Lifecycle.SingleUse`

- ## Field Summary

  ### Fields inherited from class AbstractArchiveResourceSet

  `archive, archiveEntries, archiveLock, archiveUseCount, jarContents, retainBloomFilterForArchives`

  ### Fields inherited from class AbstractResourceSet

  `sm`

  ### 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
  Constructor
  Description
  `WarResourceSet()`
  A no argument constructor is required for this to work with the digester.
  `WarResourceSet(WebResourceRoot root, String webAppMount, String base)`
  Creates a new `WebResourceSet` based on a WAR file.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected WebResource`
  `createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest)`
  Creates an archive resource.

  ### Methods inherited from class AbstractSingleArchiveResourceSet

  `getArchiveEntries, getArchiveEntry, initInternal, isMultiRelease`

  ### Methods inherited from class AbstractArchiveResourceSet

  `closeJarFile, gc, getAllowLinking, getBaseUrl, getBaseUrlString, getResource, isReadOnly, list, listWebAppPaths, mkdir, openJarFile, setAllowLinking, setBaseUrl, setReadOnly, write`

  ### Methods inherited from class AbstractResourceSet

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

  ### Methods inherited from class LifecycleBase

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

- ## Constructor Details

  - ### WarResourceSet

    public WarResourceSet()
    A no argument constructor is required for this to work with the digester.

  - ### WarResourceSet

    public WarResourceSet(WebResourceRoot root, String webAppMount, String base) throws IllegalArgumentException
    Creates a new `WebResourceSet` based on a WAR file.
    Parameters:
      `root` - The `WebResourceRoot` this new `WebResourceSet` will be added to.
      `webAppMount` - The path within the web application at which this `WebResourceSet` will be mounted.
      `base` - The absolute path to the WAR file on the file system from which the resources will be served.
    Throws:
      `IllegalArgumentException` - if the webAppMount is not valid (valid paths must start with '/')

- ## Method Details

  - ### createArchiveResource

    protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest)
    Description copied from class: `AbstractArchiveResourceSet`
    Creates an archive resource.
    Specified by:
      `createArchiveResource` in class `AbstractArchiveResourceSet`
    Parameters:
      `jarEntry` - The JAR entry
      `webAppPath` - The web application path
      `manifest` - The manifest
    Returns:
      the archive resource