public interface WebResource
File
.Modifier and Type | Method and Description |
---|---|
boolean |
canRead() |
boolean |
delete() |
boolean |
exists() |
String |
getCanonicalPath() |
Certificate[] |
getCertificates() |
URL |
getCodeBase() |
byte[] |
getContent() |
long |
getContentLength() |
long |
getCreation() |
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() |
String |
getLastModifiedHttp() |
Manifest |
getManifest() |
String |
getMimeType() |
String |
getName() |
URL |
getURL() |
String |
getWebappPath() |
WebResourceRoot |
getWebResourceRoot() |
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 . |
void |
setMimeType(String mimeType)
Set the MIME type for this Resource.
|
long getLastModified()
File.lastModified()
.String getLastModifiedHttp()
boolean exists()
File.exists()
.boolean isVirtual()
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.true
for a virtual resourceboolean isDirectory()
File.isDirectory()
.boolean isFile()
File.isFile()
.boolean delete()
File.delete()
.String getName()
File.getName()
.long getContentLength()
File.length()
.String getCanonicalPath()
File.getCanonicalPath()
.boolean canRead()
File.canRead()
.String getWebappPath()
String getETag()
void setMimeType(String mimeType)
mimeType
- The mime type that will be associated with the resourceString getMimeType()
InputStream getInputStream()
null
if the resource does not exist or does not
represent a filebyte[] getContent()
long getCreation()
getLastModified()
will be returned.URL getURL()
null
if no such URL
is available or if the resource does not exist.URL getCodeBase()
WebResourceRoot getWebResourceRoot()
Certificate[] getCertificates()
JarEntry.getCertificates()
Manifest getManifest()
JarFile.getManifest()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.