AbstractSingleArchiveResourceSet (Apache Tomcat 8.5.57 API Documentation)

org.apache.catalina.webresources

## Class AbstractSingleArchiveResourceSet

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

- All Implemented Interfaces:
    Lifecycle, WebResourceSet
  Direct Known Subclasses:
    JarResourceSet, WarResourceSet

      public abstract class AbstractSingleArchiveResourceSet
      extends AbstractArchiveResourceSet

  Base class for a `WebResourceSet` based on a single, rather than nested, archive.

- - ### Nested Class Summary

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

      `Lifecycle.SingleUse`

  - ### Field Summary

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

      `archiveEntries, archiveLock`

    - ### 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
    Constructor and Description
    `AbstractSingleArchiveResourceSet()` A no argument constructor is required for this to work with the digester.
    `AbstractSingleArchiveResourceSet(WebResourceRoot root, String webAppMount, String base, String internalPath)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected HashMap<String,JarEntry>` | `getArchiveEntries(boolean single)` Obtain the map of entries in the archive.
    `protected JarEntry` | `getArchiveEntry(String pathInArchive)` Obtain a single entry from the archive.
    `protected void` | `initInternal()` Sub-classes implement this method to perform any instance initialisation required.
    `protected boolean` | `isMultiRelease()`

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

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

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

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

- - ### Constructor Detail

    - #### AbstractSingleArchiveResourceSet

          public AbstractSingleArchiveResourceSet()

      A no argument constructor is required for this to work with the digester.

    - #### AbstractSingleArchiveResourceSet

          public AbstractSingleArchiveResourceSet(WebResourceRoot root,
                                          String webAppMount,
                                          String base,
                                          String internalPath)
                                           throws IllegalArgumentException

      Throws:
        `IllegalArgumentException`

  - ### Method Detail

    - #### getArchiveEntries

          protected HashMap<String,JarEntry> getArchiveEntries(boolean single)

      Description copied from class: `AbstractArchiveResourceSet`
      Obtain the map of entries in the archive. May return null in which case `AbstractArchiveResourceSet.getArchiveEntry(String)` should be used.
      Specified by:
        `getArchiveEntries` in class `AbstractArchiveResourceSet`
      Parameters:
        `single` - Is this request being make to support a single lookup? If false, a map will always be returned. If true, implementations may use this as a hint in determining the optimum way to respond.
      Returns:
        The archives entries mapped to their names or null if `AbstractArchiveResourceSet.getArchiveEntry(String)` should be used.

    - #### getArchiveEntry

          protected JarEntry getArchiveEntry(String pathInArchive)

      Description copied from class: `AbstractArchiveResourceSet`
      Obtain a single entry from the archive. For performance reasons, `AbstractArchiveResourceSet.getArchiveEntries(boolean)` should always be called first and the archive entry looked up in the map if one is returned. Only if that call returns null should this method be used.
      Specified by:
        `getArchiveEntry` in class `AbstractArchiveResourceSet`
      Parameters:
        `pathInArchive` - The path in the archive of the entry required
      Returns:
        The specified archive entry or null if it does not exist

    - #### isMultiRelease

          protected boolean isMultiRelease()

      Specified by:
        `isMultiRelease` in class `AbstractArchiveResourceSet`

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

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