public class JarWarResourceSet extends AbstractArchiveResourceSet
WebResourceSet based on a JAR file that is nested inside a packed WAR file.
This is only intended for internal use within Tomcat and therefore cannot be created via configuration.Lifecycle.SingleUsearchiveEntries, archiveLocksmAFTER_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 and Description |
|---|
JarWarResourceSet(WebResourceRoot root,
java.lang.String webAppMount,
java.lang.String base,
java.lang.String archivePath,
java.lang.String internalPath)
Creates a new
WebResourceSet based on a JAR file that is nested inside a WAR. |
| Modifier and Type | Method and Description |
|---|---|
protected WebResource |
createArchiveResource(java.util.jar.JarEntry jarEntry,
java.lang.String webAppPath,
java.util.jar.Manifest manifest) |
protected java.util.Map<java.lang.String,java.util.jar.JarEntry> |
getArchiveEntries(boolean single)
Obtain the map of entries in the archive.
|
protected java.util.jar.JarEntry |
getArchiveEntry(java.lang.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() |
protected void |
processArchivesEntriesForMultiRelease() |
closeJarFile, gc, getBaseUrl, getBaseUrlString, getResource, isReadOnly, list, listWebAppPaths, mkdir, openJarFile, setBaseUrl, setReadOnly, writecheckPath, destroyInternal, getBase, getClassLoaderOnly, getInternalPath, getManifest, getRoot, getStaticOnly, getWebAppMount, isPathMounted, setBase, setClassLoaderOnly, setInternalPath, setManifest, setRoot, setStaticOnly, setWebAppMount, startInternal, stopInternaladdLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stoppublic JarWarResourceSet(WebResourceRoot root, java.lang.String webAppMount, java.lang.String base, java.lang.String archivePath, java.lang.String internalPath) throws java.lang.IllegalArgumentException
WebResourceSet based on a JAR file that is nested inside a WAR.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 in which the JAR is located.archivePath - The path within the WAR file where the JAR file is located.internalPath - The path within this new WebResourceSet where resources will be
served from. E.g. for a resource JAR, this would be "META-INF/resources"java.lang.IllegalArgumentException - if the webAppMount or internalPath is not valid (valid paths must start with
'/')protected WebResource createArchiveResource(java.util.jar.JarEntry jarEntry, java.lang.String webAppPath, java.util.jar.Manifest manifest)
createArchiveResource in class AbstractArchiveResourceSetprotected java.util.Map<java.lang.String,java.util.jar.JarEntry> getArchiveEntries(boolean single)
AbstractArchiveResourceSet.getArchiveEntry(String) should
be used.
JarWar can't optimise for a single resource so the Map is always returned.
getArchiveEntries in class AbstractArchiveResourceSetsingle - 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.AbstractArchiveResourceSet.getArchiveEntry(String) should be used.protected void processArchivesEntriesForMultiRelease()
protected java.util.jar.JarEntry getArchiveEntry(java.lang.String pathInArchive)
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.
Should never be called since getArchiveEntries(boolean) always returns a Map.
getArchiveEntry in class AbstractArchiveResourceSetpathInArchive - The path in the archive of the entry requiredprotected boolean isMultiRelease()
isMultiRelease in class AbstractArchiveResourceSetprotected void initInternal()
throws LifecycleException
LifecycleBaseinitInternal in class LifecycleBaseLifecycleException - If the initialisation failsCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.