PathResource@Deprecated public class FileResource extends Resource
__defaultUseCaches| Constructor and Description |
|---|
FileResource(File file)
Deprecated.
|
FileResource(File base,
String childPath)
Deprecated.
|
FileResource(URI uri)
Deprecated.
|
FileResource(URL url)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
Resource |
addPath(String path)
Deprecated.
Returns the resource contained inside the current resource with the
given name.
|
void |
close()
Deprecated.
Release any temporary resources held by the resource.
|
void |
copyTo(File destination)
Deprecated.
Copy the Resource to the new destination file.
|
boolean |
delete()
Deprecated.
Deletes the given resource
|
boolean |
equals(Object o)
Deprecated.
|
boolean |
exists()
Deprecated.
Returns true if the resource exists.
|
URI |
getAlias()
Deprecated.
|
File |
getFile()
Deprecated.
Returns an File representing the given resource or NULL if this
is not possible.
|
InputStream |
getInputStream()
Deprecated.
Returns an input stream to the resource
|
String |
getName()
Deprecated.
Returns the name of the resource
|
ReadableByteChannel |
getReadableByteChannel()
Deprecated.
Readable ByteChannel for the resource.
|
URI |
getURI()
Deprecated.
URI representing the resource.
|
URL |
getURL()
Deprecated.
URL representing the resource.
|
int |
hashCode()
Deprecated.
|
boolean |
isContainedIn(Resource r)
Deprecated.
|
boolean |
isDirectory()
Deprecated.
Returns true if the resource is a container/directory.
|
long |
lastModified()
Deprecated.
Returns the last modified time
|
long |
length()
Deprecated.
Return the length of the resource
|
String[] |
list()
Deprecated.
Returns a list of resources contained in the given resource
|
boolean |
renameTo(Resource dest)
Deprecated.
Rename the given resource
|
String |
toString()
Deprecated.
|
encode, finalize, getAllResources, getAssociate, getDefaultUseCaches, getListHTML, getResource, getWeakETag, getWeakETag, isAlias, 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 FileResource(File file)
public Resource addPath(String path) throws IOException, MalformedURLException
ResourceaddPath in class Resourcepath - The path segment to add, which is not encodedIOException - if unable to resolve the pathMalformedURLException - if the resolution of the path fails because the input path parameter is malformed.public 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 ResourceIOException - if unable to open the input streampublic ReadableByteChannel getReadableByteChannel() throws IOException
ResourcegetReadableByteChannel in class ResourceIOException - if unable to open the readable bytechannel for the resource.public boolean delete()
throws SecurityException
delete in class ResourceSecurityException - if unable to delete due to permissionspublic boolean renameTo(Resource dest) throws SecurityException
renameTo in class Resourcedest - the destination name for the resourceSecurityException - if unable to rename due to permissionspublic String[] list()
public boolean equals(Object o)
equals in class Objecto - the object to compare against this instancetrue of the object o is a FileResource pointing to the same file as this resource.public int hashCode()
public void copyTo(File destination) throws IOException
ResourceWill not replace existing destination file.
copyTo in class Resourcedestination - the destination file to createIOException - if unable to copy the resourcepublic boolean isContainedIn(Resource r) throws MalformedURLException
isContainedIn in class ResourceMalformedURLExceptionpublic void close()
Resourcepublic URL getURL()
Resourcepublic URI getURI()
ResourceCopyright © 1995-2016 Webtide. All Rights Reserved.