|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jetty.util.resource.Resource
org.eclipse.jetty.util.resource.URLResource
org.eclipse.jetty.util.resource.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, or it can be controlled by calling the static method @see FileResource#setCheckAliases(boolean)
Field Summary |
---|
Fields inherited from class org.eclipse.jetty.util.resource.URLResource |
---|
_connection, _in, _url, _urlString |
Fields inherited from class org.eclipse.jetty.util.resource.Resource |
---|
__defaultUseCaches |
Constructor Summary | |
---|---|
FileResource(java.net.URL url)
|
Method Summary | |
---|---|
Resource |
addPath(java.lang.String path)
Returns the resource contained inside the current resource with the given name |
void |
copyTo(java.io.File destination)
|
boolean |
delete()
Deletes the given resource |
java.lang.String |
encode(java.lang.String uri)
Encode according to this resource type. |
boolean |
equals(java.lang.Object o)
|
boolean |
exists()
Returns true if the resource exists. |
java.net.URL |
getAlias()
|
static boolean |
getCheckAliases()
getCheckAliases. |
java.io.File |
getFile()
Returns an File representing the given resource or NULL if this is not possible. |
java.io.InputStream |
getInputStream()
Returns an input stream to the resource |
java.lang.String |
getName()
Returns the name of the resource |
java.io.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 |
java.lang.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.eclipse.jetty.util.resource.URLResource |
---|
checkConnection, getURL, getUseCaches, isContainedIn, release, toString |
Methods inherited from class org.eclipse.jetty.util.resource.Resource |
---|
finalize, getAssociate, getDefaultUseCaches, getListHTML, getURI, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newSystemResource, setAssociate, setDefaultUseCaches, writeTo |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileResource(java.net.URL url) throws java.io.IOException, java.net.URISyntaxException
java.io.IOException
java.net.URISyntaxException
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(java.lang.String path) throws java.io.IOException, java.net.MalformedURLException
URLResource
addPath
in class URLResource
path
- The path segment to add, which should be encoded by the
encode method.
java.io.IOException
java.net.MalformedURLException
public java.net.URL getAlias()
getAlias
in class Resource
public boolean exists()
exists
in class URLResource
public long lastModified()
lastModified
in class URLResource
public boolean isDirectory()
isDirectory
in class URLResource
public long length()
length
in class URLResource
public java.lang.String getName()
getName
in class URLResource
public java.io.File getFile()
getFile
in class URLResource
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class URLResource
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException, java.lang.SecurityException
getOutputStream
in class URLResource
java.io.IOException
java.lang.SecurityException
public boolean delete() throws java.lang.SecurityException
delete
in class URLResource
java.lang.SecurityException
public boolean renameTo(Resource dest) throws java.lang.SecurityException
renameTo
in class URLResource
java.lang.SecurityException
public java.lang.String[] list()
list
in class URLResource
public java.lang.String encode(java.lang.String uri)
encode
in class Resource
uri
- URI to encode.
public boolean equals(java.lang.Object o)
equals
in class URLResource
o
-
true
of the object o
is a FileResource
pointing to the same file as this resource.public int hashCode()
hashCode
in class URLResource
public void copyTo(java.io.File destination) throws java.io.IOException
copyTo
in class Resource
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |