Top Fields Constructors Methods
org.apache.catalina.webresources

public Class EmptyResource

extends Object
implements WebResource
Class Inheritance
All Implemented Interfaces
org.apache.catalina.WebResource
Known Direct Subclasses
org.apache.catalina.webresources.VirtualResource
Imports
java.io.File, .IOException, .InputStream, java.net.URL, java.security.cert.Certificate, java.util.jar.Manifest, org.apache.catalina.WebResource, .WebResourceRoot

Field Summary

Modifier and TypeField and Description
private final File
private final WebResourceRoot
private final String

Constructor Summary

AccessConstructor and Description
public
public
EmptyResource(WebResourceRoot root, String webAppPath, File file)

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public boolean
public String
public Certificate[]
public URL
public byte[]
public long
public long
public String
getETag()

Implements org.apache.catalina.WebResource.getETag.

Return the strong ETag if available (currently not supported) else return the weak ETag calculated from the content length and last modified.

public InputStream
getInputStream()

Implements org.apache.catalina.WebResource.getInputStream.

Obtain an InputStream based on the contents of this resource.

public long
public String
public Manifest
public String
public String
public URL
public String
public WebResourceRoot
public boolean
public boolean
public boolean
isVirtual()

Implements org.apache.catalina.WebResource.isVirtual.

Indicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additional WebResourceSet.

public void
setMimeType(String
The mime type that will be associated with the resource
mimeType
)

Implements org.apache.catalina.WebResource.setMimeType.

Set the MIME type for this Resource.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fileback to summary
private final File file
rootback to summary
private final WebResourceRoot root
webAppPathback to summary
private final String webAppPath

Constructor Detail

EmptyResourceback to summary
public EmptyResource(WebResourceRoot root, String webAppPath)
EmptyResourceback to summary
public EmptyResource(WebResourceRoot root, String webAppPath, File file)

Method Detail

canReadback to summary
public boolean canRead()

Implements org.apache.catalina.WebResource.canRead.

Returns:boolean

Doc from org.apache.catalina.WebResource.canRead.

java.io.File#canRead().

Annotations
@Override
deleteback to summary
public boolean delete()

Implements org.apache.catalina.WebResource.delete.

Returns:boolean

Doc from org.apache.catalina.WebResource.delete.

java.io.File#delete().

Annotations
@Override
existsback to summary
public boolean exists()

Implements org.apache.catalina.WebResource.exists.

Returns:boolean

Doc from org.apache.catalina.WebResource.exists.

java.io.File#exists().

Annotations
@Override
getCanonicalPathback to summary
public String getCanonicalPath()

Implements org.apache.catalina.WebResource.getCanonicalPath.

Returns:String

Doc from org.apache.catalina.WebResource.getCanonicalPath.

java.io.File#getCanonicalPath().

Annotations
@Override
getCertificatesback to summary
public Certificate[] getCertificates()

Implements org.apache.catalina.WebResource.getCertificates.

Returns:Certificate[]

Doc from org.apache.catalina.WebResource.getCertificates.

the certificates that were used to sign this resource to verify it or @null if none.

Annotations
@Override
getCodeBaseback to summary
public URL getCodeBase()

Implements org.apache.catalina.WebResource.getCodeBase.

Returns:URL

Doc from org.apache.catalina.WebResource.getCodeBase.

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.

Annotations
@Override
getContentback to summary
public byte[] getContent()

Implements org.apache.catalina.WebResource.getContent.

Returns:byte[]

Doc from org.apache.catalina.WebResource.getContent.

the binary content of this resource or null if it is not available in a byte[] because, for example, it is too big.

Annotations
@Override
getContentLengthback to summary
public long getContentLength()

Implements org.apache.catalina.WebResource.getContentLength.

Returns:long

Doc from org.apache.catalina.WebResource.getContentLength.

java.io.File#length().

Annotations
@Override
getCreationback to summary
public long getCreation()

Implements org.apache.catalina.WebResource.getCreation.

Returns:long

Doc from org.apache.catalina.WebResource.getCreation.

The time the file was created. If not available, the result of getLastModified() will be returned.

Annotations
@Override
getETagback to summary
public String getETag()

Implements org.apache.catalina.WebResource.getETag.

Doc from org.apache.catalina.WebResource.getETag.

Return the strong ETag if available (currently not supported) else return the weak ETag calculated from the content length and last modified.

Returns:String

The ETag for this resource

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream()

Implements org.apache.catalina.WebResource.getInputStream.

Doc from org.apache.catalina.WebResource.getInputStream.

Obtain an InputStream based on the contents of this resource.

Returns:InputStream

An InputStream based on the contents of this resource or null if the resource does not exist or does not represent a file

Annotations
@Override
getLastModifiedback to summary
public long getLastModified()

Implements org.apache.catalina.WebResource.getLastModified.

Returns:long

Doc from org.apache.catalina.WebResource.getLastModified.

java.io.File#lastModified().

Annotations
@Override
getLastModifiedHttpback to summary
public String getLastModifiedHttp()

Implements org.apache.catalina.WebResource.getLastModifiedHttp.

Returns:String

Doc from org.apache.catalina.WebResource.getLastModifiedHttp.

the last modified time of this resource in the correct format for the HTTP Last-Modified header as specified by RFC 2616.

Annotations
@Override
getManifestback to summary
public Manifest getManifest()

Implements org.apache.catalina.WebResource.getManifest.

Returns:Manifest

Doc from org.apache.catalina.WebResource.getManifest.

the manifest associated with this resource or @null if none.

Annotations
@Override
getMimeTypeback to summary
public String getMimeType()

Implements org.apache.catalina.WebResource.getMimeType.

Returns:String

Doc from org.apache.catalina.WebResource.getMimeType.

the MIME type for this Resource.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.apache.catalina.WebResource.getName.

Returns:String

Doc from org.apache.catalina.WebResource.getName.

java.io.File#getName().

Annotations
@Override
getURLback to summary
public URL getURL()

Implements org.apache.catalina.WebResource.getURL.

Returns:URL

Doc from org.apache.catalina.WebResource.getURL.

a URL to access the resource or null if no such URL is available or if the resource does not exist.

Annotations
@Override
getWebappPathback to summary
public String getWebappPath()

Implements org.apache.catalina.WebResource.getWebappPath.

Returns:String

Doc from org.apache.catalina.WebResource.getWebappPath.

The path of this resource relative to the web application root. If the resource is a directory, the return value will end in '/'.

Annotations
@Override
getWebResourceRootback to summary
public WebResourceRoot getWebResourceRoot()

Implements org.apache.catalina.WebResource.getWebResourceRoot.

Returns:WebResourceRoot

Doc from org.apache.catalina.WebResource.getWebResourceRoot.

a reference to the WebResourceRoot of which this WebResource is a part.

Annotations
@Override
isDirectoryback to summary
public boolean isDirectory()

Implements org.apache.catalina.WebResource.isDirectory.

Returns:boolean

Doc from org.apache.catalina.WebResource.isDirectory.

java.io.File#isDirectory().

Annotations
@Override
isFileback to summary
public boolean isFile()

Implements org.apache.catalina.WebResource.isFile.

Returns:boolean

Doc from org.apache.catalina.WebResource.isFile.

java.io.File#isFile().

Annotations
@Override
isVirtualback to summary
public boolean isVirtual()

Implements org.apache.catalina.WebResource.isVirtual.

Doc from org.apache.catalina.WebResource.isVirtual.

Indicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additional WebResourceSet. 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:boolean

true for a virtual resource

Annotations
@Override
setMimeTypeback to summary
public void setMimeType(String mimeType)

Implements org.apache.catalina.WebResource.setMimeType.

Doc from org.apache.catalina.WebResource.setMimeType.

Set the MIME type for this Resource.

Parameters
mimeType:String

The mime type that will be associated with the resource

Annotations
@Override