jodd.mail
Class EmailAttachment

java.lang.Object
  extended by jodd.mail.EmailAttachment
Direct Known Subclasses:
ByteArrayAttachment, DataSourceAttachment, FileAttachment

public abstract class EmailAttachment
extends java.lang.Object

Email attachment.


Field Summary
protected  java.lang.String contentId
           
protected  java.lang.String name
           
protected  int size
           
 
Constructor Summary
protected EmailAttachment(java.lang.String name, java.lang.String contentId)
           
 
Method Summary
 java.lang.String getContentId()
          Returns content id for inline attachments, may be null.
abstract  javax.activation.DataSource getDataSource()
           
 java.lang.String getName()
          Returns attachment name.
 int getSize()
          Returns size of received attachment,
 boolean isInline()
          Returns true if it is inline attachment.
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

name

protected final java.lang.String name

contentId

protected final java.lang.String contentId

size

protected int size
Constructor Detail

EmailAttachment

protected EmailAttachment(java.lang.String name,
                          java.lang.String contentId)
Method Detail

getName

public java.lang.String getName()
Returns attachment name.


getContentId

public java.lang.String getContentId()
Returns content id for inline attachments, may be null.


isInline

public boolean isInline()
Returns true if it is inline attachment.


getDataSource

public abstract javax.activation.DataSource getDataSource()

getSize

public int getSize()
Returns size of received attachment,


setSize

protected void setSize(int size)

toByteArray

public byte[] toByteArray()
Returns byte content of the attachment.


writeToFile

public void writeToFile(java.io.File destination)
Saves attachment to a file.


writeToStream

public void writeToStream(java.io.OutputStream out)
Saves attachment to output stream.



Copyright © 2003-2012 Jodd Team