Interface AttachmentApi
public interface AttachmentApi
Contains all api operations for handling attachments.
-
Method Summary
Modifier and TypeMethodDescriptionaddAttachment
(AddAttachmentRequest addAttachmentRequest) Create a new attachment and persist it.boolean
Returns true if an attachment with given ID exists.findAttachments
(FindAttachmentsRequest findAttachmentsRequest) Finds the attachments according to the provided request.getAttachment
(UUID attachmentId) Retrieve the attachment with the given id.Gets the content of the file contained by attachment identified by the given UUID.void
removeAttachment
(UUID id) Removes the attachment identified by the given UUID.
-
Method Details
-
addAttachment
Create a new attachment and persist it.- Parameters:
addAttachmentRequest
- Contains all information to be able to create a new attachment.- Returns:
- The created
Attachment
-
getAttachment
Retrieve the attachment with the given id.- Parameters:
attachmentId
- the attachment id- Returns:
- the attachment
-
findAttachments
@SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseFormatter.class) PagedResponse<Attachment> findAttachments(FindAttachmentsRequest findAttachmentsRequest) Finds the attachments according to the provided request.- Parameters:
findAttachmentsRequest
- the request- Returns:
- the attachments
-
exists
Returns true if an attachment with given ID exists.- Parameters:
attachmentId
- the ID of the attachment- Returns:
- true if an attachment with given ID exists,
false
otherwise
-
removeAttachment
Removes the attachment identified by the given UUID.- Parameters:
id
- the unique identifier of the attachment to delete
-
getAttachmentContent
Gets the content of the file contained by attachment identified by the given UUID.- Parameters:
id
- the UUID of the attachment- Returns:
- the content as
InputStream
-