public class Attachment
extends java.lang.Object
| Constructor and Description |
|---|
Attachment()
Initializes a new instance of the Attachment class.
|
Attachment(java.lang.String filePath)
Initializes a new instance of the Attachment class based on the supplied file.
|
Attachment(java.lang.String fileName,
byte[] buffer)
Initializes a new instance of the Attachment class based on the supplied byte array.
|
Attachment(java.lang.String fileName,
java.io.InputStream inputStream)
Instantiates a new attachment.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getAdditionalInfo()
Gets file type information for a non-Windows attachment.
|
java.lang.String |
getContentBase()
Gets the content base header of a MIME message attachment.
|
java.lang.String |
getContentDisposition()
Gets the content disposition header of a MIME message attachment.
|
java.lang.String |
getContentId()
Gets the content identification header of a MIME message attachment.
|
java.lang.String |
getContentLocation()
Gets the content location header of a MIME message attachment.
|
byte[] |
getData()
Gets binary attachment data.
|
byte[] |
getDataObject()
Gets attachment's data as embedded object.
|
java.lang.String |
getDisplayName()
Gets the display name of the attachment.
|
Message |
getEmbeddedMessage()
Gets Message object if the attachment is an embedded Message.
|
byte[] |
getEncoding()
Gets the encoding for an attachment.
|
java.lang.String |
getExtension()
Gets a file name extension that indicates the document type of an attachment.
|
java.lang.String |
getFileName()
Gets an attachment's base file name and extension, excluding path.
|
AttachmentFlags |
getFlags()
Gets flags for an attachment.
|
java.io.InputStream |
getInputStream()
Gets stream to read from this attachment.
|
java.lang.String |
getLongFileName()
Gets an attachment's long filename and extension, excluding path.
|
java.lang.String |
getLongPathName()
Gets an attachment's fully-qualified long path and filename.
|
AttachmentMethod |
getMethod()
Gets a MAPI-defined constant representing the way the contents of an attachment can be accessed.
|
long |
getMimeSequence()
Gets the MIME sequence number of a MIME message attachment.
|
java.lang.String |
getMimeTag()
Gets formatting information about a MIME attachment.
|
ObjectType |
getObjectType()
Gets the type of the attachment.
|
java.lang.String |
getPathName()
Gets an attachment's fully-qualified path and filename.
|
byte[] |
getRecordKey()
Gets the record key for an attachment.
|
byte[] |
getRendering()
Gets a metafile with rendering information for an attachment.
|
long |
getRenderingPosition()
Gets rendering position index.
|
long |
getSize()
Gets attachment's size in bytes.
|
byte[] |
getTag()
Gets an object identifier specifying the application that supplied an attachment.
|
java.lang.String |
getTransportName()
Gets the name of an attachment file modified so that it can be associated with TNEF messages.
|
boolean |
isContactPhoto()
Gets whether this attachment is a contact photo.
|
boolean |
isHidden()
Gets whether an attachment is hidden from the end user.
|
void |
save(java.io.OutputStream outputStream)
Saves this attachment to the specified stream.
|
void |
save(java.lang.String filePath)
Saves this attachment to the specified file.
|
void |
save(java.lang.String filePath,
boolean overwrite)
Saves this attachment to the specified file.
|
void |
setAdditionalInfo(byte[] additionalInfo)
Provides file type information for a non-Windows attachment.
|
void |
setContactPhoto(boolean isContactPhoto)
Sets whether this attachment is a contact photo.
|
void |
setContentBase(java.lang.String contentBase)
Sets the content base header of a MIME message attachment.
|
void |
setContentDisposition(java.lang.String contentDisposition)
Sets the content disposition header of a MIME message attachment.
|
void |
setContentId(java.lang.String contentId)
Sets the content identification header of a MIME message attachment.
|
void |
setContentLocation(java.lang.String contentLocation)
Sets the content location header of a MIME message attachment.
|
void |
setData(byte[] data)
Sets binary attachment data.
|
void |
setDataObject(byte[] dataObject)
Sets attachment's data as embedded object.
|
void |
setDisplayName(java.lang.String displayName)
Sets the display name of the attachment.
|
void |
setEmbeddedMessage(Message embeddedMessage)
Sets Message object if the attachment is an embedded Message.
|
void |
setEncoding(byte[] encoding)
Sets the encoding for an attachment.
|
void |
setExtension(java.lang.String extension)
Sets a file name extension that indicates the document type of an attachment.
|
void |
setFileName(java.lang.String fileName)
Sets an attachment's base file name and extension, excluding path.
|
void |
setFlags(AttachmentFlags flags)
Sets flags for an attachment.
|
void |
setHidden(boolean isHidden)
Sets whether an attachment is hidden from the end user.
|
void |
setLongFileName(java.lang.String longFileName)
Sets an attachment's long filename and extension, excluding path.
|
void |
setLongPathName(java.lang.String longPathName)
Sets an attachment's fully-qualified long path and filename.
|
void |
setMethod(AttachmentMethod method)
Sets a MAPI-defined constant representing the way the contents of an attachment can be accessed.
|
void |
setMimeSequence(long mimeSequence)
Sets the MIME sequence number of a MIME message attachment.
|
void |
setMimeTag(java.lang.String mimeTag)
Sets formatting information about a MIME attachment.
|
void |
setObjectType(ObjectType objectType)
Sets the type of the attachment.
|
void |
setPathName(java.lang.String pathName)
Sets an attachment's fully-qualified path and filename.
|
void |
setRecordKey(byte[] recordKey)
Sets the record key for an attachment.
|
void |
setRendering(byte[] rendering)
Sets a metafile with rendering information for an attachment.
|
void |
setRenderingPosition(long renderingPosition)
Sets rendering position index.
|
void |
setSize(long size)
Sets attachment's size in bytes.
|
void |
setTag(byte[] tag)
Sets an object identifier specifying the application that supplied an attachment.
|
void |
setTransportName(java.lang.String transportName)
Sets the name of an attachment file modified so that it can be associated with TNEF messages.
|
byte[] |
toByteArray()
Gets bytes to read from this attachment.
|
public Attachment()
public Attachment(java.lang.String filePath)
throws java.io.IOException
filePath - the file pathjava.io.IOException - Signals that an I/O exception has occurred.public Attachment(java.lang.String fileName,
java.io.InputStream inputStream)
throws java.io.IOException
fileName - the file nameinputStream - the input streamjava.io.IOException - Signals that an I/O exception has occurred.public Attachment(java.lang.String fileName,
byte[] buffer)
fileName - Attachment file name.buffer - A byte array.public void save(java.lang.String filePath)
throws java.io.IOException
filePath - File path.java.io.IOException - Signals that an I/O exception has occurred.public void save(java.lang.String filePath,
boolean overwrite)
throws java.io.IOException
filePath - File path.overwrite - True to overwrite existing file, otherwise false.java.io.IOException - Signals that an I/O exception has occurred.public void save(java.io.OutputStream outputStream)
throws java.io.IOException
outputStream - A stream.java.io.IOException - Signals that an I/O exception has occurred.public byte[] toByteArray()
public java.io.InputStream getInputStream()
public byte[] getAdditionalInfo()
public void setAdditionalInfo(byte[] additionalInfo)
additionalInfo - the new additional infopublic java.lang.String getContentBase()
public void setContentBase(java.lang.String contentBase)
contentBase - the new content basepublic java.lang.String getContentId()
public void setContentId(java.lang.String contentId)
contentId - the new content idpublic java.lang.String getContentLocation()
public void setContentLocation(java.lang.String contentLocation)
contentLocation - the new content locationpublic java.lang.String getContentDisposition()
public void setContentDisposition(java.lang.String contentDisposition)
contentDisposition - the new content dispositionpublic byte[] getData()
public void setData(byte[] data)
data - the new datapublic byte[] getDataObject()
public void setDataObject(byte[] dataObject)
dataObject - the new data objectpublic byte[] getEncoding()
public void setEncoding(byte[] encoding)
encoding - the new encodingpublic byte[] getRecordKey()
public void setRecordKey(byte[] recordKey)
recordKey - the new record keypublic java.lang.String getExtension()
public void setExtension(java.lang.String extension)
extension - the new extensionpublic java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
fileName - the new file namepublic AttachmentFlags getFlags()
public void setFlags(AttachmentFlags flags)
flags - the new flagspublic java.lang.String getLongFileName()
public void setLongFileName(java.lang.String longFileName)
longFileName - the new long file namepublic java.lang.String getLongPathName()
public void setLongPathName(java.lang.String longPathName)
longPathName - the new long path namepublic AttachmentMethod getMethod()
public void setMethod(AttachmentMethod method)
method - the new methodpublic long getMimeSequence()
public void setMimeSequence(long mimeSequence)
mimeSequence - the new mime sequencepublic java.lang.String getMimeTag()
public void setMimeTag(java.lang.String mimeTag)
mimeTag - the new mime tagpublic java.lang.String getPathName()
public void setPathName(java.lang.String pathName)
pathName - the new path namepublic byte[] getRendering()
public void setRendering(byte[] rendering)
rendering - the new renderingpublic long getRenderingPosition()
public void setRenderingPosition(long renderingPosition)
renderingPosition - the new rendering positionpublic long getSize()
public void setSize(long size)
size - the new sizepublic byte[] getTag()
public void setTag(byte[] tag)
tag - the new tagpublic java.lang.String getTransportName()
public void setTransportName(java.lang.String transportName)
transportName - the new transport namepublic java.lang.String getDisplayName()
public void setDisplayName(java.lang.String displayName)
displayName - the new display namepublic Message getEmbeddedMessage()
public void setEmbeddedMessage(Message embeddedMessage)
embeddedMessage - the new embedded messagepublic ObjectType getObjectType()
public void setObjectType(ObjectType objectType)
objectType - the new object typepublic boolean isHidden()
public void setHidden(boolean isHidden)
isHidden - the new hiddenpublic boolean isContactPhoto()
public void setContactPhoto(boolean isContactPhoto)
isContactPhoto - the new contact photo