|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.mail.StringDataSource
public class StringDataSource
StringDataSource implements the Java Activation Framework's DataSource interface to enable using a string as a data source. It is used primarily within the EmailMessage class to handle MIME attachments stored within a String or a StringBuffer.
| Constructor Summary | |
|---|---|
StringDataSource(java.lang.String s,
java.lang.String mimeType,
java.lang.String name)
Create a new StringDataSource object. |
|
| Method Summary | |
|---|---|
java.lang.String |
getContentType()
Get the content type (i.e., the MIME type) associated with the underlying string's content. |
java.io.InputStream |
getInputStream()
Get a new InputStream object that will read from this object's string buffer. |
java.lang.String |
getName()
Get the name associated with the underlying string's content. |
java.io.OutputStream |
getOutputStream()
According to the documentation for the DataSource interface, this method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringDataSource(java.lang.String s,
java.lang.String mimeType,
java.lang.String name)
s - The string from which to readmimeType - The MIME type (or content type) to associate with
the contents of the string. If this parameter is
null, it defaults to "application/octet-stream".name - The name to associate with the content. For an
email attachment, this parameter is typically used
to name the attachment. If this parameter is
null, a name will be generated.| Method Detail |
|---|
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOException - On error.
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOException - Always.public java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.lang.String getName()
getName in interface javax.activation.DataSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||