org.bouncycastle.mail.smime.util
public class FileBackedMimeBodyPart extends MimeBodyPart
Constructor and Description |
---|
FileBackedMimeBodyPart(java.io.File file)
Create a MimeBodyPart backed by the data in file.
|
FileBackedMimeBodyPart(java.io.InputStream content,
java.io.File file)
Create a MimeBodyPart backed by file based on the headers and
content data in content.
|
FileBackedMimeBodyPart(InternetHeaders headers,
java.io.InputStream body,
java.io.File file)
Create a MimeBodyPart backed by file, with the headers
given in headers and body content taken from the stream body.
|
public FileBackedMimeBodyPart(java.io.File file) throws MessagingException, java.io.IOException
file
- file containing the body part.MessagingException
- an exception occurs parsing file.java.io.IOException
- an exception occurs accessing file.public FileBackedMimeBodyPart(java.io.InputStream content, java.io.File file) throws MessagingException, java.io.IOException
content
- an inputstream containing the body part.file
- a handle to the backing file to use for storage.MessagingException
- an exception occurs parsing the resulting body part in file.java.io.IOException
- an exception occurs accessing file or content.public FileBackedMimeBodyPart(InternetHeaders headers, java.io.InputStream body, java.io.File file) throws MessagingException, java.io.IOException
headers
- headers for the body part.body
- internal content for the body part.file
- backing file to use.MessagingException
- if the body part can't be produced.java.io.IOException
- if there is an issue reading stream or writing to file.public void writeTo(java.io.OutputStream out) throws java.io.IOException, MessagingException
java.io.IOException
MessagingException
public void dispose() throws java.io.IOException
java.io.IOException
- if streams cannot be closed or the file cannot be deleted.