|
Clearspace API (1.7.0) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AttachmentContentResource
A base interface defining attachments methods.
| Method Summary | |
|---|---|
Attachment |
createAttachment(java.lang.String name,
java.lang.String contentType,
java.io.InputStream data,
java.io.File file)
Creates a new attachment for the object. |
void |
deleteAttachment(Attachment attachment)
Deletes an attachment that belongs to the object. |
Attachment |
getAttachment(long attachmentID)
Returns the attachment corresponding to the attachmentID. |
int |
getAttachmentCount()
Returns the number of attachments the object has. |
JiveIterator<Attachment> |
getAttachments()
Returns an Iterable for the object's attachments. |
| Method Detail |
|---|
int getAttachmentCount()
JiveIterator<Attachment> getAttachments()
Attachment
Attachment getAttachment(long attachmentID)
throws java.lang.IllegalArgumentException,
AttachmentNotFoundException
attachmentID - the id of the attachment to retrieve.
java.lang.IllegalArgumentException - if the attachment doesn't exist or belong to the object.
AttachmentNotFoundException - if the attachment cannot be found
Attachment createAttachment(java.lang.String name,
java.lang.String contentType,
java.io.InputStream data,
java.io.File file)
throws java.lang.IllegalStateException,
AttachmentException,
UnauthorizedException
name - the name of the new attachment, usually the file name.contentType - the content type of the attachment.data - an InputStream that contains the binary data of the attachment. The stream will
never be closed so you must close it manually after calling this method.file - object if it is available. Null value is allowed when missing the File instance
AttachmentException - if an error occurred while creating the attachment.
UnauthorizedException - if not allowed to create attachments.
java.lang.IllegalStateException - if the object hasn't yet been saved.Attachment,
AttachmentManager
void deleteAttachment(Attachment attachment)
throws AttachmentException,
UnauthorizedException
attachment - the attachment to delete.
java.lang.IllegalArgumentException - if the attachment doesn't belong to the object.
UnauthorizedException - if not authorized to delete the attachment.
AttachmentException - if there was an error deleting the attachment.
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||