public class Attachment extends AttachmentBase implements IPreferredTextEncodingProvider, IAttachment
Represents an e-mail attachment.
Constructor and Description |
---|
Attachment(InputStream contentStream,
ContentType contentType)
Initializes a new instance of the
Attachment class. |
Attachment(InputStream contentStream,
String name)
Initializes a new instance of the
Attachment class. |
Attachment(InputStream contentStream,
String name,
String mediaType)
Initializes a new instance of the
Attachment class. |
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)
Creates the attachment from string.
|
ContentDisposition |
getContentDisposition()
Gets Content-Disposition header
|
String |
getName()
Gets or sets an attachment name
|
Charset |
getNameEncoding()
Gets or sets an encoding of attachment name
|
Charset |
getPreferredTextEncoding()
Gets or sets a preferred text encoding
|
void |
setName(String value)
Gets or sets an attachment name
|
void |
setNameEncoding(Charset value)
Gets or sets an encoding of attachment name
|
void |
setPreferredTextEncoding(Charset value)
Gets or sets a preferred text encoding
|
dispose, dispose, getContentId, getContentStream, getContentType, getEncodingFromContent, getHeaders, getTransferEncoding, save, save, setContentFromString, 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)
Initializes a new instance of the Attachment
class.
contentStream
- The content stream of attachment.name
- The attachment name.public Attachment(InputStream contentStream, String name, String mediaType)
Initializes a new instance of the Attachment
class.
contentStream
- The content stream of attachment.name
- The attachment name.mediaType
- The media type name.public Attachment(InputStream contentStream, ContentType contentType)
Initializes a new instance of the Attachment
class.
contentStream
- The content stream of attachment.contentType
- The ContentType
.public String getName()
Gets or sets an attachment name
getName
in interface IAttachment
String
object.public void setName(String value)
Gets or sets an attachment name
setName
in interface IAttachment
value
- String
object.public Charset getNameEncoding()
Gets or sets an encoding of attachment name
Charset
object.public void setNameEncoding(Charset value)
Gets or sets an encoding of attachment name
value
- a Charset
object.public ContentDisposition getContentDisposition()
Gets Content-Disposition header
ContentDisposition
object.public Charset getPreferredTextEncoding()
Gets or sets a preferred text encoding
getPreferredTextEncoding
in interface IPreferredTextEncodingProvider
Charset
object.public void setPreferredTextEncoding(Charset value)
Gets or sets a preferred text encoding
setPreferredTextEncoding
in interface IPreferredTextEncodingProvider
value
- a Charset
object.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)
Creates the attachment from string.
content
- A string that represents the content of attachment.name
- The attachment name.contentEncoding
- The content encoding.mediaType
- The media type namepublic 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-2016 Aspose Pty Ltd. All Rights Reserved.