Class AbstractArchiveResource
java.lang.Object
org.apache.catalina.webresources.AbstractResource
org.apache.catalina.webresources.AbstractArchiveResource
- All Implemented Interfaces:
WebResource
- Direct Known Subclasses:
AbstractSingleArchiveResource,JarWarResource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThis wrapper assumes that the InputStream was created from a JarFile obtained from a call to getArchiveResourceSet().openJarFile(). -
Field Summary
Fields inherited from class org.apache.catalina.webresources.AbstractResource
sm -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractArchiveResource(AbstractArchiveResourceSet archiveResourceSet, String webAppPath, String baseUrl, JarEntry jarEntry) Deprecated.protectedAbstractArchiveResource(AbstractArchiveResourceSet archiveResourceSet, String webAppPath, String baseUrl, JarEntry jarEntry, String codeBaseUrl) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRead()booleandelete()protected final InputStreambooleanexists()protected AbstractArchiveResourceSetprotected final StringgetBase()protected final StringReturns the code base for this resource.final byte[]longlongprotected abstract AbstractArchiveResource.JarInputStreamWrapperlonggetName()protected final JarEntrygetURL()booleanbooleanisFile()booleanIndicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additionalWebResourceSet.Methods inherited from class org.apache.catalina.webresources.AbstractResource
getETag, getInputStream, getLastModifiedHttp, getLog, getMimeType, getStrongETag, getWebappPath, getWebResourceRoot, setMimeType
-
Constructor Details
-
AbstractArchiveResource
@Deprecated protected AbstractArchiveResource(AbstractArchiveResourceSet archiveResourceSet, String webAppPath, String baseUrl, JarEntry jarEntry) Deprecated. -
AbstractArchiveResource
protected AbstractArchiveResource(AbstractArchiveResourceSet archiveResourceSet, String webAppPath, String baseUrl, JarEntry jarEntry, String codeBaseUrl)
-
-
Method Details
-
getArchiveResourceSet
-
getBase
-
getBaseUrl
-
getResource
-
getLastModified
public long getLastModified()- Returns:
File.lastModified().
-
exists
public boolean exists()- Returns:
File.exists().
-
isVirtual
public boolean isVirtual()Description copied from interface:WebResourceIndicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additionalWebResourceSet. For example, if an external directory is mapped to /WEB-INF/lib in an otherwise empty web application, /WEB-INF will be represented as a virtual resource.- Returns:
truefor a virtual resource
-
isDirectory
public boolean isDirectory()- Returns:
File.isDirectory().
-
isFile
public boolean isFile()- Returns:
File.isFile().
-
delete
public boolean delete()- Returns:
File.delete().
-
getName
- Returns:
File.getName().
-
getContentLength
public long getContentLength()- Returns:
File.length().
-
getCanonicalPath
- Returns:
File.getCanonicalPath().
-
canRead
public boolean canRead()- Returns:
File.canRead().
-
getCreation
public long getCreation()- Returns:
- The time the file was created. If not available, the result of
WebResource.getLastModified()will be returned.
-
getURL
- Returns:
- a URL to access the resource or
nullif no such URL is available or if the resource does not exist.
-
getCodeBase
Description copied from interface:WebResourceReturns the code base for this resource.The expectation is that this will be deprecated and then removed once the SecurityManager has been fully removed from the JRE, and it has been confirmed that the JRE no longer depends on code base.
- Returns:
- the code base for this resource that will be used when looking up the assigned permissions for the code base in the security policy file when running under a security manager.
-
getContent
public final byte[] getContent()- Returns:
- the binary content of this resource or
nullif it is not available in a byte[] because, for example, it is too big.
-
getCertificates
- Returns:
- the certificates that were used to sign this resource to verify it or @null if none.
- See Also:
-
getManifest
- Returns:
- the manifest associated with this resource or @null if none.
- See Also:
-
doGetInputStream
- Specified by:
doGetInputStreamin classAbstractResource
-
getJarInputStreamWrapper
-