Package com.independentsoft.email.mime
Class BodyPart
java.lang.Object
com.independentsoft.email.mime.BodyPart
Class BodyPart.
-
Constructor Summary
ConstructorsConstructorDescriptionBodyPart()Initializes a new instance of the BodyPart class.BodyPart(Attachment attachment)Initializes a new instance of the BodyPart class. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()Gets the body.Gets the body parts.byte[]getBytes()Gets the bytes.Gets the content description.Gets the content disposition.Gets the content identifier.Gets the content location.Gets the content transfer encoding.Gets the type of the content.Gets the embedded message.Gets the header character set.Gets the header encoding.Gets the headers.Gets the stream.voidsave(OutputStream stream)Saves the specified stream.voidSaves the specified file path.voidSaves the specified file path.voidSets the body.voidsetContentDescription(String value)Sets the content description.voidSets the content disposition.voidsetContentID(String value)Sets the content identifier.voidsetContentLocation(String value)Sets the content location.voidSets the content transfer encoding.voidsetContentType(ContentType value)Sets the type of the content.voidsetEmbeddedMessage(Message embeddedMessage)Sets the embedded message.voidsetHeaderCharSet(String headerCharSet)Sets the header character set.voidsetHeaderEncoding(HeaderEncoding headerEncoding)Sets the header encoding.toString()Returns a String that represents this instance.
-
Constructor Details
-
BodyPart
public BodyPart()Initializes a new instance of the BodyPart class. -
BodyPart
Initializes a new instance of the BodyPart class.- Parameters:
attachment- The attachment.
-
-
Method Details
-
save
Saves the specified file path.- Parameters:
filePath- The file path.- Throws:
IOException- if an I/O error occurs.
-
save
Saves the specified file path.- Parameters:
filePath- The file path.overwrite- if set to true, overwrite an existing file.- Throws:
IOException- if an I/O error occurs.
-
save
Saves the specified stream.- Parameters:
stream- The stream.- Throws:
IOException- if an I/O error occurs.
-
getBytes
public byte[] getBytes()Gets the bytes.- Returns:
- The bytes.
-
getStream
Gets the stream.- Returns:
- Stream.
-
toString
Returns a String that represents this instance. -
getHeaders
Gets the headers.- Returns:
- The headers.
-
getBodyParts
Gets the body parts.- Returns:
- The body parts.
-
getBody
Gets the body.- Returns:
- The body.
-
setBody
Sets the body.- Parameters:
body- The body.
-
getEmbeddedMessage
Gets the embedded message.- Returns:
- The embedded message.
-
setEmbeddedMessage
Sets the embedded message.- Parameters:
embeddedMessage- The embedded message.
-
getHeaderEncoding
Gets the header encoding.- Returns:
- The header encoding.
-
setHeaderEncoding
Sets the header encoding.- Parameters:
headerEncoding- The header encoding.
-
getHeaderCharSet
Gets the header character set.- Returns:
- The header character set.
-
setHeaderCharSet
Sets the header character set.- Parameters:
headerCharSet- The header character set.
-
getContentType
Gets the type of the content.- Returns:
- The type of the content.
-
setContentType
Sets the type of the content.- Parameters:
value- The type of the content.
-
getContentTransferEncoding
Gets the content transfer encoding.- Returns:
- The content transfer encoding.
-
setContentTransferEncoding
Sets the content transfer encoding.- Parameters:
value- The content transfer encoding.
-
getContentDisposition
Gets the content disposition.- Returns:
- The content disposition.
-
setContentDisposition
Sets the content disposition.- Parameters:
value- The content disposition.
-
getContentDescription
Gets the content description.- Returns:
- The content description.
-
setContentDescription
Sets the content description.- Parameters:
value- The content description.
-
getContentID
Gets the content identifier.- Returns:
- The content identifier.
-
setContentID
Sets the content identifier.- Parameters:
value- The content identifier.
-
getContentLocation
Gets the content location.- Returns:
- The content location.
-
setContentLocation
Sets the content location.- Parameters:
value- The content location.
-