public class AmazonS3AttachmentServiceImpl extends Object implements AttachmentService, org.springframework.beans.factory.InitializingBean
AttachmentService implementation which utilizes AWS Simple Storage Service.
Must inject a ResourceLoader that is capable of resolving "s3://" urls as well as the name of the bucket this service should use. Also an instance of the AmazonS3 client api should be injected. The generated id of the attachment will be used as the object key is S3, so the bucket should exist only for storing the attachments managed by this service.
| Constructor and Description |
|---|
AmazonS3AttachmentServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
deleteAttachedFile(Attachment attachment) |
File |
findAttachedFile(Attachment attachment) |
org.springframework.core.io.Resource |
findAttachedResource(Attachment attachment) |
void |
persistAttachedFileAndSetAttachmentBusinessObjectValue(Attachment attachment) |
void |
setAmazonS3(com.amazonaws.services.s3.AmazonS3 amazonS3) |
void |
setBucketName(String bucketName) |
void |
setFolderName(String folderName) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
public AmazonS3AttachmentServiceImpl()
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void persistAttachedFileAndSetAttachmentBusinessObjectValue(Attachment attachment) throws Exception
persistAttachedFileAndSetAttachmentBusinessObjectValue in interface AttachmentServiceExceptionpublic File findAttachedFile(Attachment attachment) throws Exception
findAttachedFile in interface AttachmentServiceExceptionpublic org.springframework.core.io.Resource findAttachedResource(Attachment attachment)
findAttachedResource in interface AttachmentServicepublic void deleteAttachedFile(Attachment attachment) throws Exception
deleteAttachedFile in interface AttachmentServiceException@Autowired public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
public void setFolderName(String folderName)
public void setBucketName(String bucketName)
@Autowired public void setAmazonS3(com.amazonaws.services.s3.AmazonS3 amazonS3)
Copyright © 2005–2017 The Kuali Foundation. All rights reserved.