Class FileAttachmentStorage

java.lang.Object
org.exoplatform.social.core.attachment.storage.FileAttachmentStorage

public class FileAttachmentStorage extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileAttachmentStorage(org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.services.thumbnail.ImageThumbnailService imageThumbnailService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    copyAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId sourceAttachmentId, long userIdentityId)
     
    void
    deleteAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId objectAttachmentId)
     
    org.exoplatform.social.attachment.model.ObjectAttachmentDetail
    getAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId attachmentId)
     
    getAttachmentInputStream(org.exoplatform.social.attachment.model.ObjectAttachmentId attachmentId, String imageDimensions)
    Opens the content of an attached file: its thumbnail when a size is asked of an image, else the file as stored, read from its stored stream and never loaded whole in memory.
    uploadAttachment(Long attachmentId, String objectType, String objectId, String fileName, String fileMimeType, InputStream fileInputStream, long userIdentityId)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FileAttachmentStorage

      public FileAttachmentStorage(org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.services.thumbnail.ImageThumbnailService imageThumbnailService)
  • Method Details

    • copyAttachment

      public String copyAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId sourceAttachmentId, long userIdentityId)
    • uploadAttachment

      public String uploadAttachment(Long attachmentId, String objectType, String objectId, String fileName, String fileMimeType, InputStream fileInputStream, long userIdentityId) throws IOException
      Throws:
      IOException
    • getAttachment

      public org.exoplatform.social.attachment.model.ObjectAttachmentDetail getAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId attachmentId)
    • getAttachmentInputStream

      public InputStream getAttachmentInputStream(org.exoplatform.social.attachment.model.ObjectAttachmentId attachmentId, String imageDimensions) throws IOException
      Opens the content of an attached file: its thumbnail when a size is asked of an image, else the file as stored, read from its stored stream and never loaded whole in memory.
      Throws:
      NoSuchFileException - when the file or its stored content no longer exists
      IOException - when the content cannot be read, a FileNotReadyException when it cannot be read yet
    • deleteAttachment

      public void deleteAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId objectAttachmentId) throws IOException
      Throws:
      IOException