use of com.amazonaws.mobileconnectors.s3.transferutility.UploadOptions in project amplify-android by aws-amplify.
the class AWSS3StorageService method uploadInputStream.
/**
* Begin uploading an inputStream.
* @param serviceKey S3 service key
* @param inputStream Target InputStream
* @param metadata Object metadata to associate with upload
* @return A transfer observer
* @throws IOException An IOException thrown during the process writing an InputStream into a file
*/
@NonNull
public TransferObserver uploadInputStream(@NonNull String serviceKey, @NonNull InputStream inputStream, @NonNull ObjectMetadata metadata) throws IOException {
startServiceIfNotAlreadyStarted();
UploadOptions uploadOptions = UploadOptions.builder().bucket(bucket).objectMetadata(metadata).build();
return transferUtility.upload(serviceKey, inputStream, uploadOptions);
}
Aggregations