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

# Class ExtractingRoot

java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.webresources.StandardRoot
org.apache.catalina.webresources.ExtractingRoot

All Implemented Interfaces:
  `MBeanRegistration, JmxEnabled, Lifecycle, WebResourceRoot`

public class ExtractingRoot extends StandardRoot
If the main resources are packaged as a WAR file then any JARs will be extracted to the work directory and used from there.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Lifecycle

  `Lifecycle.SingleUse`

  ### Nested classes/interfaces inherited from interface WebResourceRoot

  `WebResourceRoot.ArchiveIndexStrategy, WebResourceRoot.CacheStrategy, WebResourceRoot.ResourceSetType`

- ## Field Summary

  ### 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
  `ExtractingRoot()`
  Creates a new ExtractingRoot instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `isPackedWarFile()`
  Always returns false because ExtractingRoot extracts JARs to the work directory, making the deployment behave as if it were exploded.
  `protected void`
  `processWebInfLib()`
  Class loader resources are handled by treating JARs in WEB-INF/lib as resource JARs (without the internal META-INF/resources/ prefix) mounted at WEB-INF/classes (rather than the web app root).
  `protected void`
  `stopInternal()`
  Subclasses must ensure that the state is changed to `LifecycleState.STOPPING` during the execution of this method.

  ### Methods inherited from class StandardRoot

  `addClassResources, addJarResources, addPostResources, addPreResources, backgroundProcess, createMainResourceSet, createWebResourceSet, createWebResourceSet, deregisterTrackedResource, destroyInternal, gc, getAllowLinking, getArchiveIndexStrategy, getArchiveIndexStrategyEnum, getBaseUrls, getCacheMaxSize, getCacheObjectMaxSize, getCacheStrategy, getCacheTtl, getClassLoaderResource, getClassLoaderResources, getClassResources, getContext, getDomainInternal, getJarResources, getObjectNameKeyProperties, getPostResources, getPreResources, getResource, getResource, getResourceInternal, getResources, getResourcesInternal, getTrackedResources, getTrackLockedFiles, initInternal, isCachingAllowed, isReadOnly, list, listResources, listResources, listWebAppPaths, mkdir, registerTrackedResource, registerURLStreamHandlerFactory, setAllowLinking, setArchiveIndexStrategy, setCacheMaxSize, setCacheObjectMaxSize, setCacheStrategy, setCacheTtl, setCachingAllowed, setContext, setMainResources, setReadOnly, setTrackLockedFiles, startInternal, write`

  ### Methods inherited from class LifecycleMBeanBase

  `getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister`

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

  - ### ExtractingRoot

    public ExtractingRoot()
    Creates a new ExtractingRoot instance.

- ## Method Details

  - ### processWebInfLib

    protected void processWebInfLib() throws LifecycleException
    Description copied from class: `StandardRoot`
    Class loader resources are handled by treating JARs in WEB-INF/lib as resource JARs (without the internal META-INF/resources/ prefix) mounted at WEB-INF/classes (rather than the web app root). This enables reuse of the resource handling plumbing. These resources are marked as class loader only so they are only used in the methods that are explicitly defined to return class loader resources. This prevents calls to getResource("/WEB-INF/classes") returning from one or more of the JAR files.
    Overrides:
      `processWebInfLib` in class `StandardRoot`
    Throws:
      `LifecycleException` - If an error occurs that should stop the web application from starting

  - ### isPackedWarFile

    protected boolean isPackedWarFile()
    Always returns false because ExtractingRoot extracts JARs to the work directory, making the deployment behave as if it were exploded. Callers that check isPackedWarFile() should treat this as an exploded deployment.
    Overrides:
      `isPackedWarFile` in class `StandardRoot`
    Returns:
      `true` if the application is served from a packed WAR file

  - ### stopInternal

    protected void stopInternal() throws LifecycleException
    Description copied from class: `LifecycleBase`
    Subclasses 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.
    Overrides:
      `stopInternal` in class `StandardRoot`
    Throws:
      `LifecycleException` - Stop error occurred