com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class AttachmentBase

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable
    Direct Known Subclasses:
    AlternateView, Attachment, LinkedResource


    public abstract class AttachmentBase
    extends Object
    implements com.aspose.ms.System.IDisposable

    Base class for mail attachment.

    • Constructor Detail

      • AttachmentBase

        protected AttachmentBase(String fileName)

        Initializes a new instance of the AttachmentBase class.

        Parameters:
        fileName - Name of the file.
      • AttachmentBase

        protected AttachmentBase(String fileName,
                      String mediaType)

        Initializes a new instance of the AttachmentBase class.

        Parameters:
        fileName - Name of the file.
        mediaType - Type of the media.
      • AttachmentBase

        protected AttachmentBase(String fileName,
                      ContentType contentType)

        Initializes a new instance of the AttachmentBase class.

        Parameters:
        fileName - Name of the file.
        contentType - Type of the content.
      • AttachmentBase

        protected AttachmentBase(InputStream contentStream)

        Initializes a new instance of the AttachmentBase class.

        Parameters:
        contentStream - The content stream.
      • AttachmentBase

        protected AttachmentBase(InputStream contentStream,
                      String mediaType)

        Initializes a new instance of the AttachmentBase class.

        Parameters:
        contentStream - The content stream.
        mediaType - Type of the media.
      • AttachmentBase

        protected AttachmentBase(InputStream contentStream,
                      ContentType contentType)

        Initializes a new instance of the AttachmentBase class.

        Parameters:
        contentStream - The content stream.
        contentType - Type of the content.
    • Method Detail

      • getContentStream

        public InputStream getContentStream()

        Gets or sets the content stream.

        Value: The content stream.
        Returns:
        a InputStream object.
      • setContentStream

        public void setContentStream(InputStream value)

        Gets or sets the content stream.

        Value: The content stream.
        Parameters:
        value - a InputStream object.
      • getContentId

        public String getContentId()

        Gets or sets the content id.

        Value: The content id.
      • setContentId

        public void setContentId(String value)

        Gets or sets the content id.

        Value: The content id.
      • getHeaders

        public HeaderCollection getHeaders()

        Gets headers collection of attachment.

      • getContentType

        public ContentType getContentType()

        Gets or sets the type of the content.

        Value: The type of the content.
      • setContentType

        public void setContentType(ContentType value)

        Gets or sets the type of the content.

        Value: The type of the content.
      • getTransferEncoding

        public int getTransferEncoding()

        Gets or sets the transfer encoding.

        Value: The transfer encoding.
      • setTransferEncoding

        public void setTransferEncoding(int value)

        Gets or sets the transfer encoding.

        Value: The transfer encoding.
      • save

        public void save(OutputStream stream)

        Saves the specified stream.

        Parameters:
        stream - The stream.
      • save

        public void save(String fileName)

        Saves the specified file name.

        Parameters:
        fileName - Name of the file.
      • dispose

        public void dispose()

        Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable
      • setContentFromString

        protected void setContentFromString(String contentString,
                                Charset encoding,
                                ContentType contentType,
                                int te)

        Sets the content from string.

        Parameters:
        contentString - The content string.
        encoding - The encoding.
        contentType - The content type.
        te - The transfer encoding.
      • getEncodingFromContent

        protected static Charset getEncodingFromContent(String contentString,
                                     ContentType contentType)

        Defines Encoding from content.

        Parameters:
        contentString - The content string.
        contentType - The content type.
        Returns:
        Defined encodingSystem.Text.Encoding.
      • dispose

        protected void dispose(boolean disposing)

        Releases unmanaged and - optionally - managed resources.

        Parameters:
        disposing - true to release both managed and unmanaged resources; false to release only unmanaged resources.