Class ExtractAttachmentCommand

  • All Implemented Interfaces:
    ExecutableCommand

    public class ExtractAttachmentCommand
    extends ExecutableCommandWrapper
    implements ExecutableCommand
    Downloads an Attachment from an Item that exists in the Integrity database.

    Constraints:

    • The Attachment.fileName attribute must be set.
    • The Attachment must be owned by a FieldValue.
    • The FieldValue must be owned by its Item.
    • The FieldValue must reference a Field.

    Usage:

     new ExtractAttachmentCommand(myAttachment, myFile).execute();
     
    • Constructor Detail

      • ExtractAttachmentCommand

        public ExtractAttachmentCommand​(Attachment attachment,
                                        File outputFile)
        Instantiates a command to download an attachment content.
        Parameters:
        attachment - the logical attachment.
        outputFile - the file in which the attachment content must be downloaded.
      • ExtractAttachmentCommand

        public ExtractAttachmentCommand​(Attachment attachment,
                                        OutputStream output)
        Instantiates a command to download an attachment content.
        Parameters:
        attachment - the logical attachment.
        output - the stream in which the attachment content must be written.