5.2 Transferring Data using Bayun's SecureTransferUtility
Now in order to use Bayun’s S3Wrapper instead of the standard AWS S3 SDK classes, these code snippets above change to using “Secure” versions of the corresponding classes, as below:
import com.bayun.S3wrapper.SecureAmazonS3Client;
import com.bayun.S3wrapper.SecureTransferUtility;5.2.1 Initialize the SecureTransferUtility
SecureAmazonS3Client s3 = new SecureAmazonS3Client(credentialsProvider, appContext);
SecureTransferUtility transferUtility = new SecureTransferUtility(s3, appContext); val s3 = SecureAmazonS3Client(credentialsProvider, appContext)
val transferUtility = SecureTransferUtility(s3, appContext)5.2.2 Upload a File to Amazon S3 using SecureTransferUtility
TransferObserver transferObserver = secureTransferUtility.secureUpload(
MY_BUCKET, /* The bucket to upload to */
OBJECT_KEY, /* The key for the uploaded object */
MY_FILE, /* The file where the data to upload exists */
null /* The transferListener to track progress */
); val transferObserver: TransferObserver = secureTransferUtility.secureUpload(
MY_BUCKET, /* The bucket to upload to */
OBJECT_KEY, /* The key for the uploaded object */
MY_FILE, /* The file where the data to upload exists */
null /* The transferListener to track progress */
)5.2.3 Download a File from Amazon S3 using SecureTransferUtility
5.2.4 Tracking S3 Transfer Progress using TransferObserver
Last updated