public class FutureFileResource
extends org.openqa.jetty.util.URLResource
DGF This is as per the standard Jetty FileResource, but its constructor is private, so I've copied-and-pasted it rather than extending it. It's just like the regular FileResource, but it always claims its lastModified date is in the future, to prevent caching.
Handle resources of implied or explicit file type. This class can check for aliasing in the filesystem (eg case insensitivity). By default this is turned on if the platform does not have the "/" path separator, or it can be controlled with the "org.openqa.jetty.util.FileResource.checkAliases" system parameter.
If alias checking is turned on, then aliased resources are treated as if they do not exist, nor can they be created.
| Constructor and Description |
|---|
FutureFileResource(URL url) |
FutureFileResource(URL url,
URLConnection connection,
File file) |
| Modifier and Type | Method and Description |
|---|---|
org.openqa.jetty.util.Resource |
addPath(String path) |
boolean |
delete()
Deletes the given resource
|
String |
encode(String uri)
Encode according to this resource type.
|
boolean |
equals(Object o) |
boolean |
exists()
Returns true if the resource exists.
|
URL |
getAlias() |
static boolean |
getCheckAliases()
getCheckAliases.
|
File |
getFile()
Returns an File representing the given resource or NULL if this is not possible.
|
InputStream |
getInputStream()
Returns an input stream to the resource
|
String |
getName()
Returns the name of the resource
|
OutputStream |
getOutputStream()
Returns an output stream to the resource
|
int |
hashCode() |
boolean |
isDirectory()
Returns true if the respresenetd resource is a container/directory.
|
long |
lastModified()
Returns the lastModified time, which is always in the distant future to prevent caching.
|
long |
length()
Return the length of the resource
|
String[] |
list()
Returns a list of resources contained in the given resource
|
boolean |
renameTo(org.openqa.jetty.util.Resource dest)
Rename the given resource
|
static void |
setCheckAliases(boolean checkAliases)
setCheckAliases.
|
checkConnection, getURL, release, toStringpublic FutureFileResource(URL url) throws IOException
IOExceptionpublic FutureFileResource(URL url, URLConnection connection, File file)
public static void setCheckAliases(boolean checkAliases)
checkAliases - True of resource aliases are to be checked for (eg case insensitivity or
8.3 short names) and treated as not found.public static boolean getCheckAliases()
public org.openqa.jetty.util.Resource addPath(String path) throws IOException, MalformedURLException
addPath in class org.openqa.jetty.util.URLResourceIOExceptionMalformedURLExceptionpublic URL getAlias()
getAlias in class org.openqa.jetty.util.Resourcepublic boolean exists()
exists in class org.openqa.jetty.util.URLResourcepublic long lastModified()
lastModified in class org.openqa.jetty.util.URLResourcepublic boolean isDirectory()
isDirectory in class org.openqa.jetty.util.URLResourcepublic long length()
length in class org.openqa.jetty.util.URLResourcepublic String getName()
getName in class org.openqa.jetty.util.URLResourcepublic File getFile()
getFile in class org.openqa.jetty.util.URLResourcepublic InputStream getInputStream() throws IOException
getInputStream in class org.openqa.jetty.util.URLResourceIOExceptionpublic OutputStream getOutputStream() throws IOException, SecurityException
getOutputStream in class org.openqa.jetty.util.URLResourceIOExceptionSecurityExceptionpublic boolean delete()
throws SecurityException
delete in class org.openqa.jetty.util.URLResourceSecurityExceptionpublic boolean renameTo(org.openqa.jetty.util.Resource dest)
throws SecurityException
renameTo in class org.openqa.jetty.util.URLResourceSecurityExceptionpublic String[] list()
list in class org.openqa.jetty.util.URLResourcepublic String encode(String uri)
encode in class org.openqa.jetty.util.Resourceuri - URI to encode.public boolean equals(Object o)
equals in class org.openqa.jetty.util.URLResourceo - other objecttrue if passed object uses the same File object as
this instance or if the path to both files are equal.public int hashCode()
hashCode in class org.openqa.jetty.util.URLResourceCopyright © 2015. All rights reserved.