2008-11-01 17:32:06 -04:00
|
|
|
|
2009-12-14 21:50:53 -05:00
|
|
|
package com.fsck.k9.mail;
|
2008-11-01 17:32:06 -04:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
2011-02-06 17:09:48 -05:00
|
|
|
public interface Body {
|
2014-09-14 05:20:18 -04:00
|
|
|
/**
|
|
|
|
* Returns the raw data of the body, without transfer encoding etc applied.
|
|
|
|
* TODO perhaps it would be better to have an intermediate "simple part" class where this method could reside
|
|
|
|
* because it makes no sense for multiparts
|
|
|
|
*/
|
2008-11-01 17:32:06 -04:00
|
|
|
public InputStream getInputStream() throws MessagingException;
|
2014-09-14 05:20:18 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the content transfer encoding (7bit, 8bit, quoted-printable or base64).
|
|
|
|
*/
|
2014-12-12 10:02:59 -05:00
|
|
|
public void setEncoding(String encoding) throws MessagingException;
|
2014-09-14 05:20:18 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes the body's data to the given {@link OutputStream}.
|
|
|
|
* The written data is transfer encoded (e.g. transformed to Base64 when needed).
|
|
|
|
*/
|
2008-11-01 17:32:06 -04:00
|
|
|
public void writeTo(OutputStream out) throws IOException, MessagingException;
|
|
|
|
}
|