|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.core.io.AbstractResource
org.springframework.core.io.VfsResource
public class VfsResource
VFS based Resource implementation.
Supports the corresponding VFS API versions on JBoss AS 5.x as well as 6.x.
org.jboss.virtual.VirtualFile,
org.jboss.vfs.VirtualFile| Constructor Summary | |
|---|---|
VfsResource(Object resources)
|
|
| Method Summary | |
|---|---|
Resource |
createRelative(String relativePath)
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource. |
boolean |
equals(Object obj)
This implementation compares description strings. |
boolean |
exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. |
String |
getDescription()
Return a description for this resource, to be used for error output when working with the resource. |
File |
getFile()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path. |
String |
getFilename()
This implementation always throws IllegalStateException, assuming that the resource does not have a filename. |
InputStream |
getInputStream()
Return an InputStream. |
URI |
getURI()
This implementation builds a URI based on the URL returned by AbstractResource.getURL(). |
URL |
getURL()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL. |
int |
hashCode()
This implementation returns the description's hash code. |
boolean |
isReadable()
This implementation always returns true. |
long |
lastModified()
This implementation checks the timestamp of the underlying File, if available. |
| Methods inherited from class org.springframework.core.io.AbstractResource |
|---|
contentLength, getFileForLastModifiedCheck, isOpen, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public VfsResource(Object resources)
| Method Detail |
|---|
public boolean exists()
AbstractResource
exists in interface Resourceexists in class AbstractResourcepublic boolean isReadable()
AbstractResourcetrue.
isReadable in interface ResourceisReadable in class AbstractResource
public long lastModified()
throws IOException
AbstractResource
lastModified in interface ResourcelastModified in class AbstractResourceIOException - if the resource cannot be resolved
(in the file system or as some other known physical resource type)AbstractResource.getFileForLastModifiedCheck()
public InputStream getInputStream()
throws IOException
InputStreamSourceInputStream.
It is expected that each call creates a fresh stream.
This requirement is particularly important when you consider an API such
as JavaMail, which needs to be able to read the stream multiple times when
creating mail attachments. For such a use case, it is required
that each getInputStream() call returns a fresh stream.
IOException - if the stream could not be openedMimeMessageHelper.addAttachment(String, InputStreamSource)
public URL getURL()
throws IOException
AbstractResource
getURL in interface ResourcegetURL in class AbstractResourceIOException - if the resource cannot be resolved as URL,
i.e. if the resource is not available as descriptor
public URI getURI()
throws IOException
AbstractResourceAbstractResource.getURL().
getURI in interface ResourcegetURI in class AbstractResourceIOException - if the resource cannot be resolved as URI,
i.e. if the resource is not available as descriptor
public File getFile()
throws IOException
AbstractResource
getFile in interface ResourcegetFile in class AbstractResourceIOException - if the resource cannot be resolved as absolute
file path, i.e. if the resource is not available in a file system
public Resource createRelative(String relativePath)
throws IOException
AbstractResource
createRelative in interface ResourcecreateRelative in class AbstractResourcerelativePath - the relative path (relative to this resource)
IOException - if the relative resource cannot be determinedpublic String getFilename()
AbstractResource
getFilename in interface ResourcegetFilename in class AbstractResourcepublic String getDescription()
ResourceImplementations are also encouraged to return this value
from their toString method.
Object.toString()public boolean equals(Object obj)
AbstractResource
equals in class AbstractResourceResource.getDescription()public int hashCode()
AbstractResource
hashCode in class AbstractResourceResource.getDescription()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||