| java.lang.Object org.springframework.core.io.AbstractResource
All known Subclasses: org.springframework.core.io.InputStreamResource, org.springframework.web.context.support.ServletContextResource, org.springframework.core.io.FileSystemResource, org.springframework.core.io.UrlResource, org.springframework.core.io.DescriptiveResource, org.springframework.core.io.ClassPathResource, org.springframework.web.portlet.context.PortletContextResource, org.springframework.core.io.ByteArrayResource,
AbstractResource | abstract public class AbstractResource implements Resource(Code) | | Convenience base class for
Resource implementations,
pre-implementing typical behavior.
The "exists" method will check whether a File or InputStream can
be opened; "isOpen" will always return false; "getURL" and "getFile"
throw an exception; and "toString" will return the description.
author: Juergen Hoeller since: 28.12.2003 |
Method Summary | |
public Resource | createRelative(String relativePath) This implementation throws a FileNotFoundException, assuming
that relative resources cannot be created for this resource. | public boolean | equals(Object obj) This implementation compares description strings. | public boolean | exists() This implementation checks whether a File can be opened,
falling back to whether an InputStream can be opened. | abstract public String | getDescription() This abstract method declaration shadows the method in the Resource interface.
This is necessary to make the toString implementation in this
class work on Sun's JDK 1.3 classic VM, which can't find the method when
executing toString else. | public File | getFile() This implementation throws a FileNotFoundException, assuming
that the resource cannot be resolved to an absolute file path. | public String | getFilename() This implementation always throws IllegalStateException,
assuming that the resource does not carry a filename. | public URL | getURL() This implementation throws a FileNotFoundException, assuming
that the resource cannot be resolved to a URL. | public int | hashCode() This implementation returns the description's hash code. | public boolean | isOpen() This implementation always returns false . | public String | toString() This implementation returns the description of this resource. |
createRelative | public Resource createRelative(String relativePath) throws IOException(Code) | | This implementation throws a FileNotFoundException, assuming
that relative resources cannot be created for this resource.
|
exists | public boolean exists()(Code) | | This implementation checks whether a File can be opened,
falling back to whether an InputStream can be opened.
This will cover both directories and content resources.
|
getFile | public File getFile() throws IOException(Code) | | This implementation throws a FileNotFoundException, assuming
that the resource cannot be resolved to an absolute file path.
|
getFilename | public String getFilename() throws IllegalStateException(Code) | | This implementation always throws IllegalStateException,
assuming that the resource does not carry a filename.
|
getURL | public URL getURL() throws IOException(Code) | | This implementation throws a FileNotFoundException, assuming
that the resource cannot be resolved to a URL.
|
isOpen | public boolean isOpen()(Code) | | This implementation always returns false .
|
|
|