public class FileResource extends Resource
__defaultUseCaches| Constructor and Description |
|---|
FileResource(URI uri) |
FileResource(URL url) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
addPath(String path)
Returns the resource contained inside the current resource with the
given name.
|
void |
close()
Release any temporary resources held by the resource.
|
void |
copyTo(File destination) |
boolean |
delete()
Deletes the given resource
|
boolean |
equals(Object o) |
boolean |
exists()
Returns true if the resource exists.
|
URI |
getAlias() |
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
|
ReadableByteChannel |
getReadableByteChannel()
Returns an readable bytechannel to the resource or null if one is not available.
|
URI |
getURI()
Returns an URI representing the given resource
|
URL |
getURL()
Returns an URL representing the given resource
|
int |
hashCode() |
boolean |
isContainedIn(Resource r) |
boolean |
isDirectory()
Returns true if the 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
|
String |
toString() |
encode, finalize, getAllResources, getAssociate, getDefaultUseCaches, getListHTML, getResource, getWeakETag, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, release, setAssociate, setDefaultUseCaches, toURL, writeTopublic FileResource(URL url) throws IOException, URISyntaxException
IOExceptionURISyntaxExceptionpublic FileResource(URI uri)
public Resource addPath(String path) throws IOException, MalformedURLException
ResourceaddPath in class Resourcepath - The path segment to add, which is not encodedIOExceptionMalformedURLExceptionpublic URI getAlias()
public boolean exists()
public long lastModified()
lastModified in class Resourcepublic boolean isDirectory()
isDirectory in class Resourcepublic long length()
public String getName()
public File getFile()
public InputStream getInputStream() throws IOException
getInputStream in class ResourceIOExceptionpublic ReadableByteChannel getReadableByteChannel() throws IOException
ResourcegetReadableByteChannel in class ResourceIOExceptionpublic boolean delete()
throws SecurityException
delete in class ResourceSecurityExceptionpublic boolean renameTo(Resource dest) throws SecurityException
renameTo in class ResourceSecurityExceptionpublic String[] list()
public boolean equals(Object o)
equals in class Objecto - true of the object o is a FileResource pointing to the same file as this resource.public void copyTo(File destination) throws IOException
copyTo in class ResourceIOExceptionpublic boolean isContainedIn(Resource r) throws MalformedURLException
isContainedIn in class ResourceMalformedURLExceptionpublic void close()
Resourcepublic URL getURL()
Resourcepublic URI getURI()
ResourceCopyright © 1995-2015 Webtide. All Rights Reserved.