|
||||||||||
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.DescriptiveResource
public class DescriptiveResource
Simple Resource
implementation that holds a resource description
but does not point to an actually readable resource.
To be used as placeholder if a Resource argument is demanded but not necessarily used for reading.
Constructor Summary | |
---|---|
DescriptiveResource(String description)
Create a new DescriptiveResource. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
This implementation compares the underlying description String. |
String |
getDescription()
This abstract method declaration shadows the method in the Resource interface. |
InputStream |
getInputStream()
Return an InputStream. |
int |
hashCode()
This implementation returns the hash code of the underlying description String. |
Methods inherited from class org.springframework.core.io.AbstractResource |
---|
createRelative, exists, getFile, getFilename, getURL, isOpen, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DescriptiveResource(String description)
description
- the resource descriptionMethod Detail |
---|
public InputStream getInputStream() throws IOException
InputStreamSource
For creating mail attachments, note that JavaMail needs to be able to
read the stream multiple times. 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 String getDescription()
AbstractResource
toString
implementation in this
class work on Sun's JDK 1.3 classic VM, which can't find the method when
executing toString
else. Furthermore, getDescription
is also called from equals
and hashCode
getDescription
in interface Resource
getDescription
in class AbstractResource
Resource.getDescription()
,
AbstractResource.toString()
,
AbstractResource.equals(Object)
,
AbstractResource.hashCode()
public boolean equals(Object obj)
equals
in class AbstractResource
AbstractResource.getDescription()
public int hashCode()
hashCode
in class AbstractResource
AbstractResource.getDescription()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |