ResourceFactoryPathResource@Deprecated public class FileResource extends Resource
__defaultUseCaches| Constructor | Description |
|---|---|
FileResource(java.io.File file) |
Deprecated.
|
FileResource(java.io.File base,
java.lang.String childPath) |
Deprecated.
|
FileResource(java.net.URI uri) |
Deprecated.
|
FileResource(java.net.URL url) |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
Resource |
addPath(java.lang.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(java.io.File destination) |
Deprecated.
Copy the Resource to the new destination file.
|
boolean |
delete() |
Deprecated.
Deletes the given resource
|
boolean |
equals(java.lang.Object o) |
Deprecated.
|
boolean |
exists() |
Deprecated.
Returns true if the resource exists.
|
java.net.URI |
getAlias() |
Deprecated.
|
java.io.File |
getFile() |
Deprecated.
Returns an File representing the given resource or NULL if this
is not possible.
|
java.io.InputStream |
getInputStream() |
Deprecated.
Returns an input stream to the resource
|
java.lang.String |
getName() |
Deprecated.
Returns the name of the resource
|
java.nio.channels.ReadableByteChannel |
getReadableByteChannel() |
Deprecated.
Readable ByteChannel for the resource.
|
java.net.URI |
getURI() |
Deprecated.
URI representing the resource.
|
java.net.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
|
java.lang.String[] |
list() |
Deprecated.
Returns a list of resources contained in the given resource
|
boolean |
renameTo(Resource dest) |
Deprecated.
Rename the given resource
|
java.lang.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(java.net.URL url)
throws java.io.IOException,
java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxExceptionpublic FileResource(java.net.URI uri)
public FileResource(java.io.File file)
public FileResource(java.io.File base,
java.lang.String childPath)
public Resource addPath(java.lang.String path) throws java.io.IOException, java.net.MalformedURLException
ResourceaddPath in class Resourcepath - The path segment to add, which is not encodedjava.io.IOException - if unable to resolve the pathjava.net.MalformedURLException - if the resolution of the path fails because the input path parameter is malformed.public java.net.URI getAlias()
public boolean exists()
public long lastModified()
lastModified in class Resourcepublic boolean isDirectory()
isDirectory in class Resourcepublic long length()
public java.lang.String getName()
public java.io.File getFile()
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class Resourcejava.io.IOException - if unable to open the input streampublic java.nio.channels.ReadableByteChannel getReadableByteChannel()
throws java.io.IOException
ResourcegetReadableByteChannel in class Resourcejava.io.IOException - if unable to open the readable bytechannel for the resource.public boolean delete()
throws java.lang.SecurityException
public boolean renameTo(Resource dest) throws java.lang.SecurityException
public java.lang.String[] list()
public boolean equals(java.lang.Object o)
equals in class java.lang.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()
hashCode in class java.lang.Objectpublic void copyTo(java.io.File destination)
throws java.io.IOException
ResourceWill not replace existing destination file.
public boolean isContainedIn(Resource r) throws java.net.MalformedURLException
isContainedIn in class Resourcejava.net.MalformedURLExceptionpublic void close()
Resourcepublic java.net.URL getURL()
Resourcepublic java.net.URI getURI()
Resourcepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1995–2018 Webtide. All rights reserved.