Package com.independentsoft.email.mime

# Class BodyPart

java.lang.Object
com.independentsoft.email.mime.BodyPart

public class BodyPart extends Object
Class BodyPart.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BodyPart()`
  Initializes a new instance of the BodyPart class.
  `BodyPart​(Attachment attachment)`
  Initializes a new instance of the BodyPart class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getBody()`
  Gets the body.
  `BodyPartList`
  `getBodyParts()`
  Gets the body parts.
  `byte[]`
  `getBytes()`
  Gets the bytes.
  `String`
  `getContentDescription()`
  Gets the content description.
  `ContentDisposition`
  `getContentDisposition()`
  Gets the content disposition.
  `String`
  `getContentID()`
  Gets the content identifier.
  `String`
  `getContentLocation()`
  Gets the content location.
  `ContentTransferEncoding`
  `getContentTransferEncoding()`
  Gets the content transfer encoding.
  `ContentType`
  `getContentType()`
  Gets the type of the content.
  `Message`
  `getEmbeddedMessage()`
  Gets the embedded message.
  `String`
  `getHeaderCharSet()`
  Gets the header character set.
  `HeaderEncoding`
  `getHeaderEncoding()`
  Gets the header encoding.
  `HeaderList`
  `getHeaders()`
  Gets the headers.
  `InputStream`
  `getStream()`
  Gets the stream.
  `void`
  `save​(OutputStream stream)`
  Saves the specified stream.
  `void`
  `save​(String filePath)`
  Saves the specified file path.
  `void`
  `save​(String filePath, boolean overwrite)`
  Saves the specified file path.
  `void`
  `setBody​(String body)`
  Sets the body.
  `void`
  `setContentDescription​(String value)`
  Sets the content description.
  `void`
  `setContentDisposition​(ContentDisposition value)`
  Sets the content disposition.
  `void`
  `setContentID​(String value)`
  Sets the content identifier.
  `void`
  `setContentLocation​(String value)`
  Sets the content location.
  `void`
  `setContentTransferEncoding​(ContentTransferEncoding value)`
  Sets the content transfer encoding.
  `void`
  `setContentType​(ContentType value)`
  Sets the type of the content.
  `void`
  `setEmbeddedMessage​(Message embeddedMessage)`
  Sets the embedded message.
  `void`
  `setHeaderCharSet​(String headerCharSet)`
  Sets the header character set.
  `void`
  `setHeaderEncoding​(HeaderEncoding headerEncoding)`
  Sets the header encoding.
  `String`
  `toString()`
  Returns a String that represents this instance.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### BodyPart

    public BodyPart()
    Initializes a new instance of the BodyPart class.

  - ### BodyPart

    public BodyPart​(Attachment attachment)
    Initializes a new instance of the BodyPart class.
    Parameters:
      `attachment` - The attachment.

- ## Method Details

  - ### save

    public void save​(String filePath) throws IOException
    Saves the specified file path.
    Parameters:
      `filePath` - The file path.
    Throws:
      `IOException` - if an I/O error occurs.

  - ### save

    public void save​(String filePath, boolean overwrite) throws IOException
    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

    public void save​(OutputStream stream) throws IOException
    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

    public InputStream getStream()
    Gets the stream.
    Returns:
      Stream.

  - ### toString

    public String toString()
    Returns a String that represents this instance.
    Overrides:
      `toString` in class `Object`
    Returns:
      A String that represents this instance.

  - ### getHeaders

    public HeaderList getHeaders()
    Gets the headers.
    Returns:
      The headers.

  - ### getBodyParts

    public BodyPartList getBodyParts()
    Gets the body parts.
    Returns:
      The body parts.

  - ### getBody

    public String getBody()
    Gets the body.
    Returns:
      The body.

  - ### setBody

    public void setBody​(String body)
    Sets the body.
    Parameters:
      `body` - The body.

  - ### getEmbeddedMessage

    public Message getEmbeddedMessage()
    Gets the embedded message.
    Returns:
      The embedded message.

  - ### setEmbeddedMessage

    public void setEmbeddedMessage​(Message embeddedMessage)
    Sets the embedded message.
    Parameters:
      `embeddedMessage` - The embedded message.

  - ### getHeaderEncoding

    public HeaderEncoding getHeaderEncoding()
    Gets the header encoding.
    Returns:
      The header encoding.

  - ### setHeaderEncoding

    public void setHeaderEncoding​(HeaderEncoding headerEncoding)
    Sets the header encoding.
    Parameters:
      `headerEncoding` - The header encoding.

  - ### getHeaderCharSet

    public String getHeaderCharSet()
    Gets the header character set.
    Returns:
      The header character set.

  - ### setHeaderCharSet

    public void setHeaderCharSet​(String headerCharSet)
    Sets the header character set.
    Parameters:
      `headerCharSet` - The header character set.

  - ### getContentType

    public ContentType getContentType()
    Gets the type of the content.
    Returns:
      The type of the content.

  - ### setContentType

    public void setContentType​(ContentType value)
    Sets the type of the content.
    Parameters:
      `value` - The type of the content.

  - ### getContentTransferEncoding

    public ContentTransferEncoding getContentTransferEncoding()
    Gets the content transfer encoding.
    Returns:
      The content transfer encoding.

  - ### setContentTransferEncoding

    public void setContentTransferEncoding​(ContentTransferEncoding value)
    Sets the content transfer encoding.
    Parameters:
      `value` - The content transfer encoding.

  - ### getContentDisposition

    public ContentDisposition getContentDisposition()
    Gets the content disposition.
    Returns:
      The content disposition.

  - ### setContentDisposition

    public void setContentDisposition​(ContentDisposition value)
    Sets the content disposition.
    Parameters:
      `value` - The content disposition.

  - ### getContentDescription

    public String getContentDescription()
    Gets the content description.
    Returns:
      The content description.

  - ### setContentDescription

    public void setContentDescription​(String value)
    Sets the content description.
    Parameters:
      `value` - The content description.

  - ### getContentID

    public String getContentID()
    Gets the content identifier.
    Returns:
      The content identifier.

  - ### setContentID

    public void setContentID​(String value)
    Sets the content identifier.
    Parameters:
      `value` - The content identifier.

  - ### getContentLocation

    public String getContentLocation()
    Gets the content location.
    Returns:
      The content location.

  - ### setContentLocation

    public void setContentLocation​(String value)
    Sets the content location.
    Parameters:
      `value` - The content location.