Class CreateAttachmentCommand

  • All Implemented Interfaces:
    ExecutableCommand

    public class CreateAttachmentCommand
    extends ExecutableCommandWrapper
    implements ExecutableCommand
    Uploads a new Attachment to 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 CreateAttachmentCommand(myAttachment, myFile).execute();
     
    • Constructor Detail

      • CreateAttachmentCommand

        public CreateAttachmentCommand​(Attachment attachment,
                                       File inputFile)
        Instantiates a command to create a new attachment in the database.
        Parameters:
        attachment - the logical attachment.
        inputFile - the file to upload in the database as attachment.
      • CreateAttachmentCommand

        public CreateAttachmentCommand​(Attachment attachment,
                                       InputStream input)
        Instantiates a command to create a new attachment in the database.
        Parameters:
        attachment - the logical attachment.
        input - the content to upload in the database as attachment.