public class FileResource extends AbstractResource
sm| Constructor and Description |
|---|
FileResource(WebResourceRoot root,
String webAppPath,
File resource,
boolean readOnly,
Manifest manifest) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead() |
boolean |
delete() |
protected InputStream |
doGetInputStream() |
boolean |
exists() |
String |
getCanonicalPath() |
Certificate[] |
getCertificates() |
URL |
getCodeBase() |
byte[] |
getContent() |
long |
getContentLength() |
long |
getCreation() |
long |
getLastModified() |
protected Log |
getLog() |
Manifest |
getManifest() |
String |
getName() |
URL |
getURL() |
boolean |
isDirectory() |
boolean |
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, setMimeTypepublic FileResource(WebResourceRoot root, String webAppPath, File resource, boolean readOnly, Manifest manifest)
public long getLastModified()
File.lastModified().public boolean exists()
File.exists().public boolean isVirtual()
WebResourceWebResourceSet. 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.true for a virtual resourcepublic boolean isDirectory()
File.isDirectory().public boolean isFile()
File.isFile().public boolean delete()
File.delete().public String getName()
File.getName().public long getContentLength()
File.length().public String getCanonicalPath()
File.getCanonicalPath().public boolean canRead()
File.canRead().protected InputStream doGetInputStream()
doGetInputStream in class AbstractResourcepublic final byte[] getContent()
null if it is not
available in a byte[] because, for example, it is too big.public long getCreation()
WebResource.getLastModified() will be returned.public URL getURL()
null if no such URL
is available or if the resource does not exist.public URL getCodeBase()
public Certificate[] getCertificates()
JarEntry.getCertificates()public Manifest getManifest()
JarFile.getManifest()protected Log getLog()
getLog in class AbstractResourceCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.