public class Attachment extends AttachmentBase implements IPreferredTextEncodingProvider, IAttachment
Represents an e-mail attachment.
Constructor and Description |
---|
Attachment(InputStream contentStream,
ContentType contentType) |
Attachment(InputStream contentStream,
String name) |
Attachment(InputStream contentStream,
String name,
String mediaType) |
Attachment(String fileName)
Initializes a new instance of the
Attachment class. |
Attachment(String fileName,
ContentType contentType)
Initializes a new instance of the
Attachment class. |
Attachment(String fileName,
String mediaType)
Initializes a new instance of the
Attachment class. |
Modifier and Type | Method and Description |
---|---|
static Attachment |
createAttachmentFromString(String content,
ContentType contentType)
Creates the attachment from string.
|
static Attachment |
createAttachmentFromString(String content,
String name)
Creates the attachment from string.
|
static Attachment |
createAttachmentFromString(String content,
String name,
Charset contentEncoding,
String mediaType) |
ContentDisposition |
getContentDisposition()
Gets Content-Disposition header
|
String |
getName()
Gets or sets an attachment name
|
Charset |
getNameEncoding() |
Charset |
getPreferredTextEncoding() |
void |
setName(String value) |
void |
setNameEncoding(Charset value) |
void |
setPreferredTextEncoding(Charset value) |
dispose, dispose, getContentId, getContentStream, getContentType, getTransferEncoding, save, save, saveRawContent, setContentId, setContentStream, setContentType, setTransferEncoding
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
save, save
public Attachment(String fileName)
Initializes a new instance of the Attachment
class.
fileName
- Name of the file.public Attachment(String fileName, String mediaType)
Initializes a new instance of the Attachment
class.
fileName
- Name of the file.mediaType
- Type media type name.public Attachment(String fileName, ContentType contentType)
Initializes a new instance of the Attachment
class.
fileName
- Name of the file.contentType
- The ContentType
.public Attachment(InputStream contentStream, String name)
public Attachment(InputStream contentStream, String name, String mediaType)
public Attachment(InputStream contentStream, ContentType contentType)
public String getName()
Gets or sets an attachment name
getName
in interface IAttachment
public void setName(String value)
setName
in interface IAttachment
public Charset getNameEncoding()
public void setNameEncoding(Charset value)
public ContentDisposition getContentDisposition()
Gets Content-Disposition header
public Charset getPreferredTextEncoding()
getPreferredTextEncoding
in interface IPreferredTextEncodingProvider
public void setPreferredTextEncoding(Charset value)
setPreferredTextEncoding
in interface IPreferredTextEncodingProvider
public static Attachment createAttachmentFromString(String content, String name)
Creates the attachment from string.
content
- A string that represents the content of attachment.name
- The attachment name.public static Attachment createAttachmentFromString(String content, String name, Charset contentEncoding, String mediaType)
public static Attachment createAttachmentFromString(String content, ContentType contentType)
Creates the attachment from string.
content
- A string that represents the content of attachment.contentType
- The ContentType
.Copyright (c) 2008-2014 Aspose Pty Ltd. All Rights Reserved.