|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.exchange.webdav.Attachment
This class wraps around a mail message attachment.
Constructor Summary | |
Attachment(java.lang.String sName,
java.io.InputStream src)
Constructor. |
|
Attachment(java.lang.String sName,
java.io.InputStream src,
int iSize)
Constructor. |
Method Summary | |
protected java.lang.String |
createFilename(int iIndex)
Creates the an escaped name for the file attachment. |
boolean |
equals(java.lang.Object o)
Compares the specified object with this attachment for equality. |
java.lang.String |
getExtension()
Gets the extension of this attachment. |
java.lang.String |
getHref()
Gets the absolute URL for this attachment. |
UniqueID |
getID()
Getst the id of this attachemnt. |
int |
getIndex()
Gets the index of the attachment in the list of attachments on a message. |
java.io.InputStream |
getInputStream()
Gets the input stream of this attachment to download from the Exchange server. |
java.lang.String |
getMimeTag()
Gets the MIME tage of this attachment. |
java.lang.String |
getName()
Gets the filename of this attachment. |
java.lang.String |
getPath()
Gets the path of this attachment |
java.lang.String |
getShortname()
Gets the short filename (8.3) of this attachment. |
int |
getSize()
Gets the size (in bytes) of this attachment. |
void |
serverDelete()
Deletes an attachment. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Attachment(java.lang.String sName, java.io.InputStream src) throws java.io.IOException
Attachment
constructors which takes
a length be used because that can be used as a hint for setting the content
length in the request. Using this method, the entire contents of the attachment
must first be read locally into memory to determine how big the attachment is,
then it must be re-read to send to the server.sName
- the name of file attachment (exclude the path)src
- the source input streampublic Attachment(java.lang.String sName, java.io.InputStream src, int iSize)
sName
- the name of file attachment (exclude the path)src
- the source input streamiSize
- the size of the attachmentMethod Detail |
public java.lang.String getHref()
public java.lang.String getPath()
public UniqueID getID()
public java.lang.String getName()
public java.lang.String getShortname()
null
)public java.lang.String getExtension()
null
)public int getSize()
public int getIndex()
public void serverDelete() throws ExchangeException
AbstractMessage.serverGetAttachments()
method so that you can delete multiple attachments from the collection.
However, be aware that external modifications to the attachments collection
that occur between the time that AbstractMessage.serverGetAttachments()
was originally called and the time that you call this method could make
it so that this method deletes an unexpected attachment, because the local
copy of the attachment index could be out of sync with the server.This method does not use pure WebDAV to do its work. It uses an HTTP request to simulate a browser POST with form data that would be made when a user is using OWA.
ExchangeException
- if an exception occurs while
connecting to or interacting with Exchangepublic java.lang.String getMimeTag()
null
if not foundpublic java.io.InputStream getInputStream() throws ExchangeException
protected java.lang.String createFilename(int iIndex)
iIndex
- the index to appendAbstractItem.createFilename(int)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
true
if the specified object is equal to this attachment.
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |