|
|||||||||||
| 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.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 String |
PROTOCOL_FILE
|
| Fields inherited from class org.springframework.core.io.AbstractResource |
URL_PROTOCOL_FILE |
| Constructor Summary | |
UrlResource(String path)
Create a new UrlResource. |
|
UrlResource(URL url)
Create a new UrlResource. |
|
| 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. |
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 carry a filename. |
InputStream |
getInputStream()
Return an InputStream. |
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. |
| Methods inherited from class org.springframework.core.io.AbstractResource |
exists, isOpen, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String PROTOCOL_FILE
| Constructor Detail |
public UrlResource(URL url)
url - a URL
public UrlResource(String path)
throws MalformedURLException
path - a URL path| Method Detail |
public InputStream getInputStream()
throws IOException
InputStreamSource
IOException - if the stream could not be opened
public URL getURL()
throws IOException
AbstractResource
getURL in interface ResourcegetURL in class AbstractResourceIOException
public File getFile()
throws IOException
AbstractResource
getFile in interface ResourcegetFile in class AbstractResourceIOException
public Resource createRelative(String relativePath)
throws MalformedURLException
AbstractResource
createRelative in interface ResourcecreateRelative in class AbstractResourceMalformedURLExceptionpublic 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 | ||||||||||