Interface AttachmentService

All Superinterfaces:
Service

public interface AttachmentService
extends Service
Service to create and manipulate Model Attachments.
  • Method Summary

    Modifier and Type Method Description
    ModelAttachment newAttachment()
    Creates a new ModelAttachment in memory and returns it.
    void saveAttachments​(java.util.List<ModelAttachment> attachments, java.util.List<java.io.InputStream> files, PlatformUserContext creator)
    Stores the given InputStreams on disk for the given ModelAttachments, populating their filePaths.
  • Method Details

    • newAttachment

      ModelAttachment newAttachment()
      Creates a new ModelAttachment in memory and returns it. Does not store anything to the database.
    • saveAttachments

      void saveAttachments​(java.util.List<ModelAttachment> attachments, java.util.List<java.io.InputStream> files, PlatformUserContext creator)
      Stores the given InputStreams on disk for the given ModelAttachments, populating their filePaths. The attachments are stored in order. (The first unsaved attachment uses the first InputStream in the list and so on.) Any attachments which already have a stored filepath are unaffected.

      A model action still has to be called to persist this to the database.

      Parameters:
      attachments - The model attachment list which might have unsaved attachments.
      files - The list of files to be saved in the order of the unsaved attachments.
      creator - The creator of the attachments