Class FileAttachmentStorage
java.lang.Object
org.exoplatform.social.core.attachment.storage.FileAttachmentStorage
-
Constructor Summary
ConstructorsConstructorDescriptionFileAttachmentStorage(org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.services.thumbnail.ImageThumbnailService imageThumbnailService) -
Method Summary
Modifier and TypeMethodDescriptioncopyAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId sourceAttachmentId, long userIdentityId) voiddeleteAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId objectAttachmentId) org.exoplatform.social.attachment.model.ObjectAttachmentDetailgetAttachment(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)
-
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 existsIOException- when the content cannot be read, aFileNotReadyExceptionwhen it cannot be read yet
-
deleteAttachment
public void deleteAttachment(org.exoplatform.social.attachment.model.ObjectAttachmentId objectAttachmentId) throws IOException - Throws:
IOException
-