public class EmptyResource extends Object implements WebResource
Constructor and Description |
---|
EmptyResource(WebResourceRoot root,
String webAppPath) |
EmptyResource(WebResourceRoot root,
String webAppPath,
File file) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead()
See
File.canRead() . |
boolean |
delete()
See
File.delete() . |
boolean |
exists()
See
File.exists() . |
String |
getCanonicalPath()
|
Certificate[] |
getCertificates()
Obtain the certificates that were used to sign this resource to verify
it or @null if none.
|
URL |
getCodeBase()
Get 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.
|
byte[] |
getContent()
Obtain the cached binary content of this resource.
|
long |
getContentLength()
See
File.length() . |
long |
getCreation()
The time the file was created.
|
String |
getETag()
Return the strong ETag if available (currently not supported) else return
the weak ETag calculated from the content length and last modified.
|
InputStream |
getInputStream()
Obtain an InputStream based on the contents of this resource.
|
long |
getLastModified()
See
File.lastModified() . |
String |
getLastModifiedHttp()
Return the last modified time of this resource in the correct format for
the HTTP Last-Modified header as specified by RFC 2616.
|
Manifest |
getManifest()
Obtain the manifest associated with this resource or @null if none.
|
String |
getMimeType()
Get the MIME type for this Resource.
|
String |
getName()
See
File.getName() . |
URL |
getURL()
Obtain a URL to access the resource or
null if no such URL
is available or if the resource does not exist. |
String |
getWebappPath()
The path of this resource relative to the web application root.
|
WebResourceRoot |
getWebResourceRoot()
Obtain a reference to the WebResourceRoot of which this WebResource is a
part.
|
boolean |
isDirectory()
See
File.isDirectory() . |
boolean |
isFile()
See
File.isFile() . |
boolean |
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 . |
void |
setMimeType(String mimeType)
Set the MIME type for this Resource.
|
public EmptyResource(WebResourceRoot root, String webAppPath)
public EmptyResource(WebResourceRoot root, String webAppPath, File file)
public long getLastModified()
WebResource
File.lastModified()
.getLastModified
in interface WebResource
public String getLastModifiedHttp()
WebResource
getLastModifiedHttp
in interface WebResource
public boolean exists()
WebResource
File.exists()
.exists
in interface WebResource
public boolean isVirtual()
WebResource
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.isVirtual
in interface WebResource
public boolean isDirectory()
WebResource
File.isDirectory()
.isDirectory
in interface WebResource
public boolean isFile()
WebResource
File.isFile()
.isFile
in interface WebResource
public boolean delete()
WebResource
File.delete()
.delete
in interface WebResource
public String getName()
WebResource
File.getName()
.getName
in interface WebResource
public long getContentLength()
WebResource
File.length()
.getContentLength
in interface WebResource
public String getCanonicalPath()
WebResource
getCanonicalPath
in interface WebResource
public boolean canRead()
WebResource
File.canRead()
.canRead
in interface WebResource
public String getWebappPath()
WebResource
getWebappPath
in interface WebResource
public String getETag()
WebResource
getETag
in interface WebResource
public void setMimeType(String mimeType)
WebResource
setMimeType
in interface WebResource
public String getMimeType()
WebResource
getMimeType
in interface WebResource
public InputStream getInputStream()
WebResource
getInputStream
in interface WebResource
null
if the resource does not exist or does not
represent a filepublic byte[] getContent()
WebResource
getContent
in interface WebResource
public long getCreation()
WebResource
WebResource.getLastModified()
will be returned.getCreation
in interface WebResource
public URL getURL()
WebResource
null
if no such URL
is available or if the resource does not exist.getURL
in interface WebResource
public URL getCodeBase()
WebResource
getCodeBase
in interface WebResource
public Certificate[] getCertificates()
WebResource
getCertificates
in interface WebResource
JarEntry.getCertificates()
public Manifest getManifest()
WebResource
getManifest
in interface WebResource
JarFile.getManifest()
public WebResourceRoot getWebResourceRoot()
WebResource
getWebResourceRoot
in interface WebResource
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.