public class PathResource extends Resource
__defaultUseCaches| Constructor and Description |
|---|
PathResource(File file) |
PathResource(Path path) |
PathResource(URI uri) |
PathResource(URL url) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
addPath(String apath)
Returns the resource contained inside the current resource with the
given name.
|
void |
close()
Release any temporary resources held by the resource.
|
boolean |
delete()
Deletes the given resource
|
boolean |
equals(Object obj) |
boolean |
exists()
Returns true if the respresened resource exists.
|
URI |
getAlias() |
File |
getFile()
Returns an File representing the given resource or NULL if this
is not possible.
|
boolean |
getFollowLinks() |
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 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 resource names contained in the given resource
The resource names are not URL encoded.
|
boolean |
renameTo(Resource dest)
Rename the given resource
|
void |
setFollowLinks(boolean followLinks) |
copyTo, encode, finalize, getAllResources, getAssociate, getDefaultUseCaches, getListHTML, getResource, getWeakETag, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, release, setAssociate, setDefaultUseCaches, toURL, writeTopublic PathResource(File file)
public PathResource(Path path)
public PathResource(URI uri) throws IOException
IOExceptionpublic PathResource(URL url) throws IOException, URISyntaxException
IOExceptionURISyntaxExceptionpublic Resource addPath(String apath) throws IOException, MalformedURLException
ResourceaddPath in class Resourceapath - The path segment to add, which is not encodedIOExceptionMalformedURLExceptionpublic void close()
Resourcepublic boolean delete()
throws SecurityException
Resourcedelete in class ResourceSecurityExceptionpublic boolean exists()
Resourcepublic File getFile() throws IOException
ResourcegetFile in class ResourceIOExceptionpublic boolean getFollowLinks()
public InputStream getInputStream() throws IOException
ResourcegetInputStream in class ResourceIOExceptionpublic String getName()
Resourcepublic ReadableByteChannel getReadableByteChannel() throws IOException
ResourcegetReadableByteChannel in class ResourceIOExceptionpublic URI getURI()
Resourcepublic URL getURL()
Resourcepublic boolean isContainedIn(Resource r) throws MalformedURLException
isContainedIn in class ResourceMalformedURLExceptionpublic boolean isDirectory()
ResourceisDirectory in class Resourcepublic long lastModified()
ResourcelastModified in class Resourcepublic long length()
Resourcepublic URI getAlias()
public String[] list()
Resourcepublic boolean renameTo(Resource dest) throws SecurityException
ResourcerenameTo in class ResourceSecurityExceptionpublic void setFollowLinks(boolean followLinks)
Copyright © 1995-2015 Webtide. All Rights Reserved.