|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openqa.jetty.util.Resource
org.openqa.jetty.util.URLResource
org.openqa.jetty.util.FileResource
public class FileResource
File Resource. 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.
| Field Summary |
|---|
| Fields inherited from class org.openqa.jetty.util.URLResource |
|---|
_connection, _in, _url, _urlString |
| Method Summary | |
|---|---|
Resource |
addPath(String path)
Returns the resource contained inside the current resource with the given name |
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 last modified time |
long |
length()
Return the length of the resource |
String[] |
list()
Returns a list of resources contained in the given resource |
boolean |
renameTo(Resource dest)
Rename the given resource |
static void |
setCheckAliases(boolean checkAliases)
setCheckAliases. |
| Methods inherited from class org.openqa.jetty.util.URLResource |
|---|
checkConnection, getURL, release, toString |
| Methods inherited from class org.openqa.jetty.util.Resource |
|---|
cache, finalize, getAssociate, getListHTML, newResource, newResource, newSystemResource, setAssociate, writeTo |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
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 Resource addPath(String path)
throws IOException,
MalformedURLException
URLResource
addPath in class URLResourcepath - The path segment to add, which should be encoded by the
encode method.
IOException
MalformedURLExceptionpublic URL getAlias()
getAlias in class Resourcepublic boolean exists()
exists in class URLResourcepublic long lastModified()
lastModified in class URLResourcepublic boolean isDirectory()
isDirectory in class URLResourcepublic long length()
length in class URLResourcepublic String getName()
getName in class URLResourcepublic File getFile()
getFile in class URLResource
public InputStream getInputStream()
throws IOException
getInputStream in class URLResourceIOException
public OutputStream getOutputStream()
throws IOException,
SecurityException
getOutputStream in class URLResourceIOException
SecurityException
public boolean delete()
throws SecurityException
delete in class URLResourceSecurityException
public boolean renameTo(Resource dest)
throws SecurityException
renameTo in class URLResourceSecurityExceptionpublic String[] list()
list in class URLResourcepublic String encode(String uri)
encode in class Resourceuri - URI to encode.
public boolean equals(Object o)
equals in class URLResourceo -
public int hashCode()
hashCode in class URLResource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||