|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.net.mail.Email.Attachment
public static class Email.Attachment
Attachment represents an attachment to an email.
Attachment requires the javax.activation package
if the method getContentType() is called and the
type has not been explicitly set before.
| Constructor Summary | |
|---|---|
Email.Attachment(Email.Attachment a)
|
|
Email.Attachment(String fileName,
byte[] content,
String type)
|
|
| Method Summary | |
|---|---|
void |
addHeader(String name,
String value)
sets additional custom header |
byte[] |
getContent()
|
String |
getContentID()
returns the content ID that allows an HTML email to refer to this content for embedding (for example an image). |
String |
getContentType()
if the content has not been explicitly set (or if the attachment was instanciated through a File object), this method call requires the javax.activation package. |
Email.Header[] |
getHeader()
returns all headers |
Set<String> |
getHeaderNames()
returns a set of String objects containing all header names |
String[] |
getHeaderValues(String name)
|
InputStream |
getInputStream()
|
String |
getName()
|
OutputStream |
getOutputStream()
always throws IOException; functionality not supported |
boolean |
isInline()
|
boolean |
removeHeader(Email.Header h)
|
MyFile |
saveToDir(File dir)
the name of the attachment will be used as the file name; existing files would be overwritten |
void |
saveToFile(File file)
|
void |
setContentID(String cid)
surrounds the given cid with '<>' when adding it as header information; note that an attachment with a content ID is considered to be displayed inline in regards to the the Content-Disposition. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Email.Attachment(Email.Attachment a)
public Email.Attachment(String fileName,
byte[] content,
String type)
| Method Detail |
|---|
public Email.Header[] getHeader()
public Set<String> getHeaderNames()
public String[] getHeaderValues(String name)
public void addHeader(String name,
String value)
public boolean removeHeader(Email.Header h)
public String getName()
getName in interface DataSourcepublic byte[] getContent()
public String toString()
toString in class Objectpublic String getContentID()
"<img src=\"cid:" + cid + "\" />"in the body of the HTML message. The returned content ID does not entail the '<>' characters that are automatically placed when using
setContentID(String).
public void setContentID(String cid)
getContentID()public boolean isInline()
public String getContentType()
getContentType in interface DataSource
public OutputStream getOutputStream()
throws IOException
getOutputStream in interface DataSourceIOException
public InputStream getInputStream()
throws IOException
getInputStream in interface DataSourceIOException
public MyFile saveToDir(File dir)
throws IOException
IOException
public void saveToFile(File file)
throws IOException
IOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||