|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.io.AbstractResource org.springframework.core.io.FileSystemResource
Resource implementation for java.io.File handles. Obviously supports resolution as File, and also as URL.
File
Field Summary |
Fields inherited from class org.springframework.core.io.AbstractResource |
URL_PROTOCOL_FILE |
Constructor Summary | |
FileSystemResource(java.io.File file)
Create a new FileSystemResource. |
|
FileSystemResource(java.lang.String path)
Create a new FileSystemResource. |
Method Summary | |
boolean |
exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. |
java.lang.String |
getDescription()
Return a description for this resource, to be used for error output when working with the resource. |
java.io.File |
getFile()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path. |
java.io.InputStream |
getInputStream()
Return an InputStream. |
java.net.URL |
getURL()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL. |
Methods inherited from class org.springframework.core.io.AbstractResource |
equals, hashCode, isOpen, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FileSystemResource(java.io.File file)
file
- a File handlepublic FileSystemResource(java.lang.String path)
path
- a file pathMethod Detail |
public boolean exists()
AbstractResource
exists
in interface Resource
exists
in class AbstractResource
public java.io.InputStream getInputStream() throws java.io.IOException
InputStreamSource
java.io.IOException
- if the stream could not be openedpublic java.net.URL getURL() throws java.io.IOException
AbstractResource
getURL
in interface Resource
getURL
in class AbstractResource
java.io.IOException
public java.io.File getFile()
AbstractResource
getFile
in interface Resource
getFile
in class AbstractResource
public java.lang.String getDescription()
Resource
Implementations are also encouraged to return this value from their toString method.
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |