Package com.polarion.alm.tracker.model
Interface IWithAttachments<T extends IAttachmentBase>
public interface IWithAttachments<T extends IAttachmentBase>
Common interface for objects that contains attachments.
- Since:
- 3.9.0
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAttachment
(String fileName, String title, InputStream data) Creates the (temporary) attachment object, which can be manipulated by the client.void
deleteAttachment
(T attachment) Removes attachment.getAttachment
(String attachmentId) Returns attachment with given id.Returns all attachments of this object.
-
Field Details
-
KEY_ATTACHMENTS
- See Also:
-
-
Method Details
-
createAttachment
@NotNull T createAttachment(@NotNull String fileName, @Nullable String title, @NotNull InputStream data) Creates the (temporary) attachment object, which can be manipulated by the client. However, the attachment is not persisted until it's explicitly saved.The author field is automatically pre-filled with the current user.
- Parameters:
fileName
- The file name, can not benull
.title
- The title (can benull
- file name is used then).data
- The content input stream, can not benull
- Returns:
- the temporary
IAttachement
created
-
getAttachments
Returns all attachments of this object.- Returns:
- attachments (never
null
)
-
getAttachment
Returns attachment with given id.- Parameters:
attachmentId
- attachment's id (notnull
)- Returns:
- attachment or
null
if not found
-
deleteAttachment
Removes attachment.- Parameters:
attachment
- attachment (notnull
)
-