|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.mail.EmailAttachment
public abstract class EmailAttachment
Email attachment.
| Field Summary | |
|---|---|
protected java.lang.String |
contentId
|
protected java.lang.String |
name
|
protected int |
size
|
protected EmailMessage |
targetMessage
|
| Constructor Summary | |
|---|---|
protected |
EmailAttachment(java.lang.String name,
java.lang.String contentId)
Creates new attachment with given name and content id for inline attachments. |
| Method Summary | |
|---|---|
static EmailAttachmentBuilder |
attachment()
Creates builder for convenient
building of the email attachments. |
java.lang.String |
getContentId()
Returns content id for inline attachments. |
abstract javax.activation.DataSource |
getDataSource()
Returns DataSource implementation, depending of attachment source. |
java.lang.String |
getName()
Returns attachment name. |
int |
getSize()
Returns size of received attachment, |
boolean |
isEmbeddedInto(EmailMessage emailMessage)
Returns true if attachment is embedded into provided message. |
boolean |
isInline()
Returns true if it is inline attachment. |
void |
setEmbeddedMessage(EmailMessage emailMessage)
Sets target message for embedded attachments. |
protected void |
setSize(int size)
|
byte[] |
toByteArray()
Returns byte content of the attachment. |
void |
writeToFile(java.io.File destination)
Saves attachment to a file. |
void |
writeToStream(java.io.OutputStream out)
Saves attachment to output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.lang.String name
protected final java.lang.String contentId
protected EmailMessage targetMessage
protected int size
| Constructor Detail |
|---|
protected EmailAttachment(java.lang.String name,
java.lang.String contentId)
null if attachment is not embedded.
| Method Detail |
|---|
public static EmailAttachmentBuilder attachment()
builder for convenient
building of the email attachments.
public java.lang.String getName()
public java.lang.String getContentId()
null when attachment is not embedded.
public boolean isInline()
true if it is inline attachment.
public void setEmbeddedMessage(EmailMessage emailMessage)
public boolean isEmbeddedInto(EmailMessage emailMessage)
true if attachment is embedded into provided message.
public abstract javax.activation.DataSource getDataSource()
DataSource implementation, depending of attachment source.
public int getSize()
protected void setSize(int size)
public byte[] toByteArray()
public void writeToFile(java.io.File destination)
public void writeToStream(java.io.OutputStream out)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||