|
Clearspace API (2.5.18) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AttachmentManager
Manages attachment settings. There are three main properties that can administered with respect to attachments:
Attachment| Method Summary | |
|---|---|
void |
addAllowedType(String contentType)
Adds a content type to the list of explicitly allowed types. |
void |
addDisallowedType(String contentType)
Adds a content type to the list of explicitly disallowed types. |
Attachment |
createAttachment(AttachmentContentResource attachmentContentResource,
String name,
String contentType,
InputStream data,
File file)
Creates a new attachment for the object. |
void |
deleteAttachment(Attachment attachment)
Deletes an attachment that belongs to the object. |
List<String> |
getAllowedTypes()
Returns a List of explicitly allowed types. |
List<String> |
getAllowedTypesAsFileExtensions()
Returns a list of explicitly allowed file types by extensions. |
Attachment |
getAttachment(long attachmentID)
Returns the attachment corresponding to the attachmentID. |
int |
getAttachmentCount(AttachmentContentResource attachmentContentResource)
Returns the number of attachments the object has. |
JiveIterator<Attachment> |
getAttachments(AttachmentContentResource attachmentContentResource)
Returns an Iterable for the object's attachments. |
List<String> |
getDisallowedTypes()
Returns a List of explicitly disallowed types. |
List<String> |
getDisallowedTypesAsFileExtensions()
Returns a list of explicitly disallowed file types by default extensions. |
int |
getImagePreviewMaxSize()
Returns the max dimension of generated thumbnails (ie, the max value for the width or height). |
int |
getMaxAttachmentSize()
Returns the maximum size of an individual attachment in kilobytes. |
int |
getMaxAttachmentsPerBlogPost()
Returns the maximum number of attachments per blog post. |
int |
getMaxAttachmentsPerDocument()
Returns the maximum number of attachments per document. |
int |
getMaxAttachmentsPerMessage()
Returns the maximum number of attachments per message. |
boolean |
isAllowAllByDefault()
Returns true if in the "allow all content types by default" mode. |
boolean |
isAttachmentsEnabled()
Returns true if attachments are enabled, false otherwise. |
boolean |
isImagePreviewEnabled()
Returns true if image preview support is enabled. |
boolean |
isImagePreviewRatioEnabled()
Returns true if the aspect ratio of thumbnails should be preserved. |
boolean |
isValidType(String contentType)
Returns true if the content type is valid based on the current settings of the allowAllByDefault flag and the allowed and disallowed types list. |
void |
removeAllowedType(String contentType)
Removes a content type fromt he list of explicitly allowed types. |
void |
removeDisallowedType(String contentType)
Removes a content type from the list of explicitly disallowed types. |
void |
setAllowAllByDefault(boolean allowAllByDefault)
Sets the default allowed content types mode. |
void |
setAttachmentParent(Attachment attachment,
AttachmentContentResource attachmentContentResource)
Configures the attachment parent for an attachment which was added originally as a temporary attachment. |
void |
setAttachmentsEnabled(boolean enabled)
Sets whether attachments are enabled, false otherwise. |
void |
setImagePreviewEnabled(boolean imagePreviewEnabled)
Toggles whether image preview support is enabled. |
void |
setImagePreviewMaxSize(int imagePreviewMaxSize)
Sets the max dimension of generated thumbnails (ie, the max value for the width or height). |
void |
setImagePreviewRatioEnabled(boolean imagePreviewRatioEnabled)
Toggles whether the aspect ratio of thumbnails should be preserved. |
void |
setMaxAttachmentSize(int maxAttachmentSize)
Sets the maximum size of an individual attachment in kilobytes. |
void |
setMaxAttachmentsPerBlogPost(int maxAttachmentsPerBlogPost)
Sets the maximum number of attachments per blog post. |
void |
setMaxAttachmentsPerDocument(int maxAttachmentsPerDocument)
Sets the maximum number of attachments per document. |
void |
setMaxAttachmentsPerMessage(int maxAttachmentsPerMessage)
Sets the maximum number of attachments per message. |
| Methods inherited from interface com.jivesoftware.community.JiveManager |
|---|
destroy |
| Method Detail |
|---|
boolean isAttachmentsEnabled()
void setAttachmentsEnabled(boolean enabled)
throws UnauthorizedException
enabled - true if attachments are enabled, false otherwise.
UnauthorizedException - if not a system administrator.int getMaxAttachmentSize()
void setMaxAttachmentSize(int maxAttachmentSize)
throws UnauthorizedException
maxAttachmentSize - the max size in kilobytes of any single attachment.
UnauthorizedException - if not an administrator.int getMaxAttachmentsPerDocument()
void setMaxAttachmentsPerDocument(int maxAttachmentsPerDocument)
throws UnauthorizedException
maxAttachmentsPerDocument - the max number of attachments allowed per document.
UnauthorizedException - if not an administrator.boolean isValidType(String contentType)
contentType - the content type to test.
void addAllowedType(String contentType)
throws UnauthorizedException
contentType - a content type to add to the explicitly allowed types list.
UnauthorizedException - if not an administrator.
void removeAllowedType(String contentType)
throws UnauthorizedException
contentType - a content type to remove from the explicitly allowed types list.
UnauthorizedException - if not an administrator.List<String> getAllowedTypes()
List<String> getAllowedTypesAsFileExtensions()
void addDisallowedType(String contentType)
throws UnauthorizedException
contentType - a content type to add to the explicitly disallowed types list.
UnauthorizedException - if not an administrator.
void removeDisallowedType(String contentType)
throws UnauthorizedException
contentType - a content type to remove from the explicitly disallowed types list.
UnauthorizedException - if not an administrator.List<String> getDisallowedTypes()
List<String> getDisallowedTypesAsFileExtensions()
boolean isAllowAllByDefault()
void setAllowAllByDefault(boolean allowAllByDefault)
throws UnauthorizedException
allowAllByDefault - true if all content types should be allowed by default.
UnauthorizedException - if does not have admin permissions.boolean isImagePreviewEnabled()
void setImagePreviewEnabled(boolean imagePreviewEnabled)
throws UnauthorizedException
imagePreviewEnabled - true if thumbnail support should be enabled.
UnauthorizedException - if not a system administrator.int getImagePreviewMaxSize()
void setImagePreviewMaxSize(int imagePreviewMaxSize)
throws UnauthorizedException
imagePreviewMaxSize - the max dimension of a thumbnail.
UnauthorizedException - if not a system administrator.boolean isImagePreviewRatioEnabled()
void setImagePreviewRatioEnabled(boolean imagePreviewRatioEnabled)
throws UnauthorizedException
imagePreviewRatioEnabled - true if the aspect ration should be preserved.
UnauthorizedException - if not a system administrator.int getMaxAttachmentsPerMessage()
void setMaxAttachmentsPerMessage(int maxAttachmentsPerMessage)
throws UnauthorizedException
maxAttachmentsPerMessage - the max number of attachments allowed per message.
UnauthorizedException - if not an administrator.int getMaxAttachmentsPerBlogPost()
void setMaxAttachmentsPerBlogPost(int maxAttachmentsPerBlogPost)
throws UnauthorizedException
maxAttachmentsPerBlogPost - the max number of attachments allowed per blog post.
UnauthorizedException - if not an administrator.int getAttachmentCount(AttachmentContentResource attachmentContentResource)
attachmentContentResource - the resource to get the attachment count for
JiveIterator<Attachment> getAttachments(AttachmentContentResource attachmentContentResource)
attachmentContentResource - the resource to get attachments for
Attachment
Attachment getAttachment(long attachmentID)
throws IllegalArgumentException,
AttachmentNotFoundException
attachmentID - the id of the attachment to retrieve.
IllegalArgumentException - if the attachment doesn't exist or belong to the object.
AttachmentNotFoundException - if the attachment cannot be found
Attachment createAttachment(AttachmentContentResource attachmentContentResource,
String name,
String contentType,
InputStream data,
File file)
throws IllegalStateException,
AttachmentException,
UnauthorizedException
attachmentContentResource - the resource to create the attachment forname - 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.
IllegalStateException - if the object hasn't yet been saved.Attachment,
AttachmentManager
void deleteAttachment(Attachment attachment)
throws AttachmentException,
UnauthorizedException
attachment - the attachment to delete.
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.
void setAttachmentParent(Attachment attachment,
AttachmentContentResource attachmentContentResource)
throws AttachmentException,
AttachmentNotFoundException
attachment - the attachment which is being createdattachmentContentResource - the parent which is being created for the attachment.
AttachmentException - indecates there was an error updating the attachment
AttachmentNotFoundException - indicates that the attachment could not be loaded.
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||