|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.transport.mailets.listservcommands.MailDataSource
MailDataSource implements a typed DataSource from :
an InputStream, a byte array, and a string
This is used from BaseCommand.generateMail(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
Field Summary | |
protected String |
contentType
|
protected byte[] |
data
|
protected static int |
DEFAULT_BUF_SIZE
|
protected static String |
DEFAULT_ENCODING
|
protected static String |
DEFAULT_NAME
|
Constructor Summary | |
MailDataSource(byte[] data,
String contentType)
Create a datasource from a byte array |
|
MailDataSource(InputStream inputStream,
String contentType)
Create a datasource from an input stream |
|
MailDataSource(String data,
String contentType)
Create a datasource from a String |
Method Summary | |
protected static int |
copyStream(InputStream inputStream,
OutputStream outputStream)
|
String |
getContentType()
returns the contentType for this data source |
InputStream |
getInputStream()
returns the inputStream |
String |
getName()
returns a static moniker |
OutputStream |
getOutputStream()
Not implemented |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int DEFAULT_BUF_SIZE
protected static final String DEFAULT_ENCODING
protected static final String DEFAULT_NAME
protected byte[] data
protected String contentType
Constructor Detail |
public MailDataSource(InputStream inputStream, String contentType) throws IOException
public MailDataSource(byte[] data, String contentType)
public MailDataSource(String data, String contentType) throws UnsupportedEncodingException
Method Detail |
public InputStream getInputStream() throws IOException
getInputStream
in interface DataSource
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface DataSource
IOException
public String getContentType()
getContentType
in interface DataSource
public String getName()
getName
in interface DataSource
protected static int copyStream(InputStream inputStream, OutputStream outputStream) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |