public class FileResource extends URLResource
_connection, _in, _url, _urlString__defaultUseCaches| Constructor and Description |
|---|
FileResource(java.net.URL url) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
checkConnection, getURL, getUseCaches, isContainedIn, release, toStringfinalize, getAssociate, getDefaultUseCaches, getListHTML, getResource, getURI, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, setAssociate, setDefaultUseCaches, toURL, writeTopublic FileResource(java.net.URL url)
throws java.io.IOException,
java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxExceptionpublic 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
URLResourceaddPath in class URLResourcepath - The path segment to add, which should be encoded by the
encode method.java.io.IOExceptionjava.net.MalformedURLExceptionpublic java.net.URL getAlias()
public boolean exists()
exists in class URLResourcepublic long lastModified()
lastModified in class URLResourcepublic boolean isDirectory()
isDirectory in class URLResourcepublic long length()
length in class URLResourcepublic java.lang.String getName()
getName in class URLResourcepublic java.io.File getFile()
getFile in class URLResourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class URLResourcejava.io.IOExceptionpublic java.io.OutputStream getOutputStream()
throws java.io.IOException,
java.lang.SecurityException
getOutputStream in class URLResourcejava.io.IOExceptionjava.lang.SecurityExceptionpublic boolean delete()
throws java.lang.SecurityException
delete in class URLResourcejava.lang.SecurityExceptionpublic boolean renameTo(Resource dest) throws java.lang.SecurityException
renameTo in class URLResourcejava.lang.SecurityExceptionpublic java.lang.String[] list()
list in class URLResourcepublic java.lang.String encode(java.lang.String uri)
public boolean equals(java.lang.Object o)
equals in class URLResourceo - true of the object o is a FileResource pointing to the same file as this resource.public int hashCode()
hashCode in class URLResourceCopyright © 2013 FuseSource, Corp.. All Rights Reserved.