public final class AttachmentResourceHelper extends Object
AttachmentResourceHandler| Modifier and Type | Field and Description |
|---|---|
static String |
MULTIPART_FORM_DATA
Form type multipart/form-data.
|
| Modifier and Type | Method and Description |
|---|---|
static AttachmentResource |
buildAttachmentResource(AttachmentData attachment)
Converts a list item describing an attachment into an attachment resource
|
static AttachmentResource |
buildAttachmentResource(AttachmentTO attachment)
Builds an attachment resource for REST-API out of the core attachment.
|
static AttachmentResource[] |
buildAttachmentResources(Collection<AttachmentData> attachments)
Converts a collection of attachment list items into an array of attachment resources
|
static void |
checkAttachmentSize(org.apache.commons.fileupload.FileItem file)
Check attachment size and throw
MaxLengthReachedException |
static void |
checkAttachmentUploadSessionId(String attachmentUploadSessionId)
Check for attachmentUploadSessionId Parameter and throw
ParameterValidationException |
static ResourceStoringManagement |
getResourceStoringManagement()
Get the resource storing management.
|
public static final String MULTIPART_FORM_DATA
public static AttachmentResource buildAttachmentResource(AttachmentData attachment)
attachment - a list item to convertpublic static AttachmentResource buildAttachmentResource(AttachmentTO attachment)
attachment - the attachment of the corepublic static AttachmentResource[] buildAttachmentResources(Collection<AttachmentData> attachments)
attachments - the list items to convert, can be null which will result in an empty arraypublic static void checkAttachmentSize(org.apache.commons.fileupload.FileItem file)
throws MaxLengthReachedException
MaxLengthReachedExceptionfile - the file to uploadMaxLengthReachedException - exception for file is to largepublic static void checkAttachmentUploadSessionId(String attachmentUploadSessionId) throws ParameterValidationException
ParameterValidationExceptionattachmentUploadSessionId - identifier of attribute in sessionParameterValidationException - attachmentUploadSessionId was not setpublic static ResourceStoringManagement getResourceStoringManagement()
Copyright © 2019 Communote team. All rights reserved.