Package 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
AbstractWebResourceSetimplementation that provides common functionality for all web resource set implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringManagersmThe string manager for this class.-
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 Modifier Constructor Description protectedAbstractResourceSet()Constructs a new AbstractResourceSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckPath(java.lang.String path)Checks that the given path is valid.protected voiddestroyInternal()Destroys this resource set.protected java.lang.StringgetBase()Gets the base.booleangetClassLoaderOnly()Checks if this resource set is class loader only.protected java.lang.StringgetInternalPath()Gets the internal path.protected java.util.jar.ManifestgetManifest()Gets the manifest.protected WebResourceRootgetRoot()Gets the root.booleangetStaticOnly()Checks if this resource set is static only.protected java.lang.StringgetWebAppMount()Gets the web app mount.protected booleanisPathMounted(java.lang.String path, java.lang.String webAppMount)Checks if the given path is mounted at the given web app mount.voidsetBase(java.lang.String base)Sets the base.voidsetClassLoaderOnly(boolean classLoaderOnly)Sets whether this resource set is class loader only.voidsetInternalPath(java.lang.String internalPath)Sets the internal path.protected voidsetManifest(java.util.jar.Manifest manifest)Sets the manifest.voidsetRoot(WebResourceRoot root)Sets the root.voidsetStaticOnly(boolean staticOnly)Sets whether this resource set is static only.voidsetWebAppMount(java.lang.String webAppMount)Sets the web app mount.protected voidstartInternal()Starts this resource set.protected voidstopInternal()Stops this resource set.-
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.Lifecycle
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
-
Methods inherited from interface org.apache.catalina.WebResourceSet
gc, getAllowLinking, getBaseUrl, getResource, isReadOnly, list, listWebAppPaths, mkdir, setAllowLinking, setReadOnly, write
-
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The string manager for this class.
-
-
Method Detail
-
checkPath
protected final void checkPath(java.lang.String path)
Checks that the given path is valid.- Parameters:
path- The path to check- Throws:
java.lang.IllegalArgumentException- if the path is invalid
-
setRoot
public final void setRoot(WebResourceRoot root)
Sets the root.- Specified by:
setRootin interfaceWebResourceSet- Parameters:
root- The root
-
getRoot
protected final WebResourceRoot getRoot()
Gets the root.- Returns:
- The root
-
getInternalPath
protected final java.lang.String getInternalPath()
Gets the internal path.- Returns:
- The internal path
-
setInternalPath
public final void setInternalPath(java.lang.String internalPath)
Sets the internal path.- Parameters:
internalPath- The internal path
-
setWebAppMount
public final void setWebAppMount(java.lang.String webAppMount)
Sets the web app mount.- Parameters:
webAppMount- The web app mount
-
getWebAppMount
protected final java.lang.String getWebAppMount()
Gets the web app mount.- Returns:
- The web app mount
-
isPathMounted
protected boolean isPathMounted(java.lang.String path, java.lang.String webAppMount)Checks if the given path is mounted at the given web app mount.- Parameters:
path- The path to checkwebAppMount- The web app mount- Returns:
trueif the path is mounted
-
setBase
public final void setBase(java.lang.String base)
Sets the base.- Parameters:
base- The base
-
getBase
protected final java.lang.String getBase()
Gets the base.- Returns:
- The base
-
getClassLoaderOnly
public boolean getClassLoaderOnly()
Checks if this resource set is class loader only.- Specified by:
getClassLoaderOnlyin interfaceWebResourceSet- Returns:
trueif this resource set is class loader only
-
setClassLoaderOnly
public void setClassLoaderOnly(boolean classLoaderOnly)
Sets whether this resource set is class loader only.- Specified by:
setClassLoaderOnlyin interfaceWebResourceSet- Parameters:
classLoaderOnly-trueif this resource set is class loader only
-
getStaticOnly
public boolean getStaticOnly()
Checks if this resource set is static only.- Specified by:
getStaticOnlyin interfaceWebResourceSet- Returns:
trueif this resource set is static only
-
setStaticOnly
public void setStaticOnly(boolean staticOnly)
Sets whether this resource set is static only.- Specified by:
setStaticOnlyin interfaceWebResourceSet- Parameters:
staticOnly-trueif this resource set is static only
-
setManifest
protected final void setManifest(java.util.jar.Manifest manifest)
Sets the manifest.- Parameters:
manifest- The manifest
-
getManifest
protected final java.util.jar.Manifest getManifest()
Gets the manifest.- Returns:
- The manifest
-
startInternal
protected final void startInternal() throws LifecycleExceptionStarts this resource set.- Specified by:
startInternalin classLifecycleBase- Throws:
LifecycleException- if a startup error occurs
-
stopInternal
protected final void stopInternal() throws LifecycleExceptionStops this resource set.- Specified by:
stopInternalin classLifecycleBase- Throws:
LifecycleException- if a shutdown error occurs
-
destroyInternal
protected final void destroyInternal() throws LifecycleExceptionDestroys this resource set.- Specified by:
destroyInternalin classLifecycleBase- Throws:
LifecycleException- if a destroy error occurs
-
-