public class FileResource extends AbstractResource
sm
Constructor and Description |
---|
FileResource(WebResourceRoot root,
String webAppPath,
File resource,
boolean readOnly) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead()
See
File.canRead() . |
boolean |
delete()
See
File.delete() . |
protected InputStream |
doGetInputStream() |
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.
|
long |
getLastModified()
See
File.lastModified() . |
protected Log |
getLog() |
Manifest |
getManifest()
Obtain the manifest associated with this resource or @null if none.
|
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. |
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 . |
getETag, getInputStream, getLastModifiedHttp, getMimeType, getWebappPath, getWebResourceRoot, setMimeType
public FileResource(WebResourceRoot root, String webAppPath, File resource, boolean readOnly)
public long getLastModified()
WebResource
File.lastModified()
.public boolean exists()
WebResource
File.exists()
.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.public boolean isDirectory()
WebResource
File.isDirectory()
.public boolean isFile()
WebResource
File.isFile()
.public boolean delete()
WebResource
File.delete()
.public String getName()
WebResource
File.getName()
.public long getContentLength()
WebResource
File.length()
.public String getCanonicalPath()
WebResource
public boolean canRead()
WebResource
File.canRead()
.protected InputStream doGetInputStream()
doGetInputStream
in class AbstractResource
public final byte[] getContent()
WebResource
public long getCreation()
WebResource
WebResource.getLastModified()
will be returned.public URL getURL()
WebResource
null
if no such URL
is available or if the resource does not exist.public URL getCodeBase()
WebResource
public Certificate[] getCertificates()
WebResource
JarEntry.getCertificates()
public Manifest getManifest()
WebResource
JarFile.getManifest()
protected Log getLog()
getLog
in class AbstractResource
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.