return StorageType.S3;
}
@Override
public FileData fetchFile(final DocumentData documentData) throws DocumentNotFoundException {
FileData fileData = null;
final String fileName = documentData.fileName();
try {
logger.info("Downloading an object");
final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, documentData.fileLocation()));
fileData = new FileData(s3object.getObjectContent(), fileName, documentData.contentType());
} catch (final AmazonClientException ace) {
logger.error(ace.getMessage());
throw new DocumentNotFoundException(documentData.getParentEntityType(), documentData.getParentEntityId(), documentData.getId());
}
return fileData;