public class JarResourceSet extends AbstractArchiveResourceSet
WebResourceSet
based on a JAR file.Lifecycle.SingleUse
archiveEntries, archiveLock
sm
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 and Description |
---|
JarResourceSet()
A no argument constructor is required for this to work with the digester.
|
JarResourceSet(WebResourceRoot root,
String webAppMount,
String base,
String internalPath)
Creates a new
WebResourceSet based on a JAR
file. |
Modifier and Type | Method and Description |
---|---|
protected WebResource |
createArchiveResource(JarEntry jarEntry,
String webAppPath,
Manifest manifest) |
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() |
closeJarFile, gc, getBaseUrl, getBaseUrlString, getResource, isReadOnly, list, listWebAppPaths, mkdir, openJarFile, setBaseUrl, setReadOnly, write
checkPath, destroyInternal, getBase, getClassLoaderOnly, getInternalPath, getManifest, getRoot, getStaticOnly, getWebAppMount, setBase, setClassLoaderOnly, setInternalPath, setManifest, setRoot, setStaticOnly, setWebAppMount, startInternal, stopInternal
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
public JarResourceSet()
public JarResourceSet(WebResourceRoot root, String webAppMount, String base, String internalPath) throws IllegalArgumentException
WebResourceSet
based on a JAR
file.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 JAR file on the file system
from which the resources will be served.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"IllegalArgumentException
- if the webAppMount or internalPath is
not valid (valid paths must start with '/')protected WebResource createArchiveResource(JarEntry jarEntry, String webAppPath, Manifest manifest)
createArchiveResource
in class AbstractArchiveResourceSet
protected HashMap<String,JarEntry> getArchiveEntries(boolean single)
AbstractArchiveResourceSet
AbstractArchiveResourceSet.getArchiveEntry(String)
should be used.getArchiveEntries
in class AbstractArchiveResourceSet
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.AbstractArchiveResourceSet.getArchiveEntry(String)
should be used.protected JarEntry getArchiveEntry(String pathInArchive)
AbstractArchiveResourceSet
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.getArchiveEntry
in class AbstractArchiveResourceSet
pathInArchive
- The path in the archive of the entry requiredprotected void initInternal() throws LifecycleException
initInternal
in class LifecycleBase
LifecycleException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.