PathResource
@Deprecated public class FileResource extends Resource
__defaultUseCaches
Constructor and 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 and 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, newResource, newSystemResource, release, setAssociate, setDefaultUseCaches, toURL, writeTo
public FileResource(java.net.URL url) throws java.io.IOException, java.net.URISyntaxException
java.io.IOException
java.net.URISyntaxException
public 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
Resource
addPath
in class Resource
path
- 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 Resource
public boolean isDirectory()
isDirectory
in class Resource
public long length()
public java.lang.String getName()
public java.io.File getFile()
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class Resource
java.io.IOException
- if unable to open the input streampublic java.nio.channels.ReadableByteChannel getReadableByteChannel() throws java.io.IOException
Resource
getReadableByteChannel
in class Resource
java.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.Object
o
- 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.Object
public void copyTo(java.io.File destination) throws java.io.IOException
Resource
Will not replace existing destination file.
public boolean isContainedIn(Resource r) throws java.net.MalformedURLException
isContainedIn
in class Resource
java.net.MalformedURLException
public void close()
Resource
public java.net.URL getURL()
Resource
public java.net.URI getURI()
Resource
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2023 Webtide. All rights reserved.