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()

        Initializes a new instance of the AttachmentBase class.

      • AttachmentBase

        protected AttachmentBase(InputStream contentStream,
                      String name,
                      String mediaType)

        Initializes a new instance of the AttachmentBase class.

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

        protected AttachmentBase(com.aspose.ms.System.IO.Stream contentStream,
                      String name,
                      String mediaType)
      • 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 final InputStream getContentStream()

        Gets or sets the content stream.

        Value: The content stream.
      • setContentStream

        public final void setContentStream(InputStream value)

        Gets or sets the content stream.

        Value: The content stream.
      • generateContentId

        protected String generateContentId()

        Generates the content id value.

        Returns:
      • getContentId

        public final String getContentId()

        Gets or sets the content id.

        Value: The content id.
      • setContentId

        public final 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 final ContentType getContentType()

        Gets or sets the type of the content.

        Value: The type of the content.
      • setContentType

        public final void setContentType(ContentType value)

        Gets or sets the type of the content.

        Value: The type of the content.
      • getTransferEncoding

        public final int getTransferEncoding()

        Gets or sets the transfer encoding.

        Value: The transfer encoding.
      • setTransferEncoding

        public final 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 final 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 final 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 encodingCharset.
      • 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.