public abstract class AttachmentBase extends Object implements com.aspose.ms.System.IDisposable
Base class for mail attachment.
Modifier | Constructor and Description |
---|---|
protected |
AttachmentBase()
Initializes a new instance of the
AttachmentBase class. |
protected |
AttachmentBase(InputStream contentStream)
Initializes a new instance of the
AttachmentBase class. |
protected |
AttachmentBase(InputStream contentStream,
ContentType contentType)
Initializes a new instance of the
AttachmentBase class. |
protected |
AttachmentBase(InputStream contentStream,
String mediaType)
Initializes a new instance of the
AttachmentBase class. |
protected |
AttachmentBase(InputStream contentStream,
String name,
String mediaType)
Initializes a new instance of the
AttachmentBase class. |
protected |
AttachmentBase(com.aspose.ms.System.IO.Stream contentStream,
String name,
String mediaType) |
protected |
AttachmentBase(String fileName)
Initializes a new instance of the
AttachmentBase class. |
protected |
AttachmentBase(String fileName,
ContentType contentType)
Initializes a new instance of the
AttachmentBase class. |
protected |
AttachmentBase(String fileName,
String mediaType)
Initializes a new instance of the
AttachmentBase class. |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Performs application-defined tasks associated with freeing,
releasing, or resetting unmanaged resources.
|
protected void |
dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
|
protected String |
generateContentId()
Generates the content id value.
|
String |
getContentId()
Gets or sets the content id.
|
InputStream |
getContentStream()
Gets or sets the content stream.
|
ContentType |
getContentType()
Gets or sets the type of the content.
|
protected static Charset |
getEncodingFromContent(String contentString,
ContentType contentType)
Defines Encoding from content.
|
HeaderCollection |
getHeaders()
Gets headers collection of attachment.
|
int |
getTransferEncoding()
Gets or sets the transfer encoding.
|
void |
save(OutputStream stream)
Saves the specified stream.
|
void |
save(String fileName)
Saves the specified file name.
|
protected void |
setContentFromString(String contentString,
Charset encoding,
ContentType contentType,
int te)
Sets the content from string.
|
void |
setContentId(String value)
Gets or sets the content id.
|
void |
setContentStream(InputStream value)
Gets or sets the content stream.
|
void |
setContentType(ContentType value)
Gets or sets the type of the content.
|
void |
setTransferEncoding(int value)
Gets or sets the transfer encoding.
|
protected AttachmentBase()
Initializes a new instance of the AttachmentBase
class.
protected AttachmentBase(InputStream contentStream, String name, String mediaType)
Initializes a new instance of the AttachmentBase
class.
contentStream
- The content stream.name
- The attachment name.mediaType
- Type of the media.protected AttachmentBase(com.aspose.ms.System.IO.Stream contentStream, String name, String mediaType)
protected AttachmentBase(String fileName)
Initializes a new instance of the AttachmentBase
class.
fileName
- Name of the file.protected AttachmentBase(String fileName, String mediaType)
Initializes a new instance of the AttachmentBase
class.
fileName
- Name of the file.mediaType
- Type of the media.protected AttachmentBase(String fileName, ContentType contentType)
Initializes a new instance of the AttachmentBase
class.
fileName
- Name of the file.contentType
- Type of the content.protected AttachmentBase(InputStream contentStream)
Initializes a new instance of the AttachmentBase
class.
contentStream
- The content stream.protected AttachmentBase(InputStream contentStream, String mediaType)
Initializes a new instance of the AttachmentBase
class.
contentStream
- The content stream.mediaType
- Type of the media.protected AttachmentBase(InputStream contentStream, ContentType contentType)
Initializes a new instance of the AttachmentBase
class.
contentStream
- The content stream.contentType
- Type of the content.public final InputStream getContentStream()
Gets or sets the content stream.
Value: The content stream.public final void setContentStream(InputStream value)
Gets or sets the content stream.
Value: The content stream.protected String generateContentId()
Generates the content id value.
public final String getContentId()
Gets or sets the content id.
Value: The content id.public final void setContentId(String value)
Gets or sets the content id.
Value: The content id.public HeaderCollection getHeaders()
Gets headers collection of attachment.
public final ContentType getContentType()
Gets or sets the type of the content.
Value: The type of the content.public final void setContentType(ContentType value)
Gets or sets the type of the content.
Value: The type of the content.public final int getTransferEncoding()
Gets or sets the transfer encoding.
Value: The transfer encoding.public final void setTransferEncoding(int value)
Gets or sets the transfer encoding.
Value: The transfer encoding.public void save(OutputStream stream)
Saves the specified stream.
stream
- The stream.public void save(String fileName)
Saves the specified file name.
fileName
- Name of the file.public final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface com.aspose.ms.System.IDisposable
protected final void setContentFromString(String contentString, Charset encoding, ContentType contentType, int te)
Sets the content from string.
contentString
- The content string.encoding
- The encoding.contentType
- The content type.te
- The transfer encoding.protected static Charset getEncodingFromContent(String contentString, ContentType contentType)
Defines Encoding from content.
contentString
- The content string.contentType
- The content type.Charset
.protected void dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
disposing
- true
to release
both managed and unmanaged resources; false
to release only unmanaged resources.