Interface IWithAttachments<T extends IAttachmentBase>

All Known Subinterfaces:
IModule, IRichPage, ITestRun, IWorkItem

public interface IWithAttachments<T extends IAttachmentBase>
Common interface for objects that contains attachments.
Since:
3.9.0
  • Field Details

  • 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 be null.
      title - The title (can be null - file name is used then).
      data - The content input stream, can not be null
      Returns:
      the temporary IAttachement created
    • getAttachments

      @NotNull IPObjectList<T> getAttachments()
      Returns all attachments of this object.
      Returns:
      attachments (never null)
    • getAttachment

      @Nullable T getAttachment(@NotNull String attachmentId)
      Returns attachment with given id.
      Parameters:
      attachmentId - attachment's id (not null)
      Returns:
      attachment or null if not found
    • deleteAttachment

      void deleteAttachment(@NotNull T attachment)
      Removes attachment.
      Parameters:
      attachment - attachment (not null)