|
|||||||||||
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.UrlResource
Resource implementation for java.net.URL locators. Obviously supports resolution as URL, and also as File in case of the "file:" protocol.
URL
Field Summary | |
static java.lang.String |
PROTOCOL_FILE
|
Fields inherited from class org.springframework.core.io.AbstractResource |
URL_PROTOCOL_FILE |
Constructor Summary | |
UrlResource(java.lang.String path)
Create a new UrlResource. |
|
UrlResource(java.net.URL url)
Create a new UrlResource. |
Method Summary | |
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. |
Methods inherited from class org.springframework.core.io.AbstractResource |
equals, exists, getURL, hashCode, isOpen, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PROTOCOL_FILE
Constructor Detail |
public UrlResource(java.net.URL url)
url
- a URLpublic UrlResource(java.lang.String path) throws java.net.MalformedURLException
path
- a URL pathMethod Detail |
public java.io.InputStream getInputStream() throws java.io.IOException
InputStreamSource
java.io.IOException
- if the stream could not be openedpublic java.io.File getFile() throws java.io.IOException
AbstractResource
getFile
in interface Resource
getFile
in class AbstractResource
java.io.IOException
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 |