com.buabook.amazon.interfaces.IAmazonS3Uploader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of amazon-s3-file-transfer Show documentation
Show all versions of amazon-s3-file-transfer Show documentation
Provides file upload and download wrapper classes for Amazon AWS SDK (c) 2017 Sport Trades Ltd
The newest version!
package com.buabook.amazon.interfaces;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.buabook.amazon.exceptions.FileUploadDownloadFailedException;
import com.buabook.amazon.pojos.UploadContent;
/**
* Amazon S3 Upload Interface
* (c) 2017 Sport Trades Ltd
*
* @author Jas Rajasansir
* @version 1.0.0
* @since 20 Feb 2017
*/
public interface IAmazonS3Uploader {
static final Logger log = LoggerFactory.getLogger(IAmazonS3Uploader.class);
/**
* Uploads the specified content to Amazon. Any upload error will be thrown back to the caller.
* @throws FileUploadDownloadFailedException
*/
public void upload(UploadContent dataToUpload) throws FileUploadDownloadFailedException;
/**
* Uploads the specified content to Amazon. Any upload error is caught and logged and no
* error is returned to the caller.
* @see #upload(UploadContent)
*/
default void uploadSuppressed(UploadContent dataToUpload) {
try {
upload(dataToUpload);
} catch(FileUploadDownloadFailedException | RuntimeException e) {
log.info("[ Exception Suppressed ] {}", e.getMessage(), e);
}
}
}