Search in sources :

Example 1 with AWSS3StorageUploadInputStreamOperation

use of com.amplifyframework.storage.s3.operation.AWSS3StorageUploadInputStreamOperation in project amplify-android by aws-amplify.

the class AWSS3StoragePlugin method uploadInputStream.

@NonNull
@Override
public StorageUploadInputStreamOperation<?> uploadInputStream(@NonNull String key, @NonNull InputStream local, @NonNull StorageUploadInputStreamOptions options, @NonNull Consumer<StorageTransferProgress> onProgress, @NonNull Consumer<StorageUploadInputStreamResult> onSuccess, @NonNull Consumer<StorageException> onError) {
    AWSS3StorageUploadRequest<InputStream> request = new AWSS3StorageUploadRequest<>(key, local, options.getAccessLevel() != null ? options.getAccessLevel() : defaultAccessLevel, options.getTargetIdentityId(), options.getContentType(), options instanceof AWSS3StorageUploadInputStreamOptions ? ((AWSS3StorageUploadInputStreamOptions) options).getServerSideEncryption() : ServerSideEncryption.NONE, options.getMetadata());
    AWSS3StorageUploadInputStreamOperation operation = new AWSS3StorageUploadInputStreamOperation(storageService, cognitoAuthProvider, request, awsS3StoragePluginConfiguration, onProgress, onSuccess, onError);
    operation.start();
    return operation;
}
Also used : AWSS3StorageUploadInputStreamOperation(com.amplifyframework.storage.s3.operation.AWSS3StorageUploadInputStreamOperation) InputStream(java.io.InputStream) AWSS3StorageUploadInputStreamOptions(com.amplifyframework.storage.s3.options.AWSS3StorageUploadInputStreamOptions) AWSS3StorageUploadRequest(com.amplifyframework.storage.s3.request.AWSS3StorageUploadRequest) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)1 AWSS3StorageUploadInputStreamOperation (com.amplifyframework.storage.s3.operation.AWSS3StorageUploadInputStreamOperation)1 AWSS3StorageUploadInputStreamOptions (com.amplifyframework.storage.s3.options.AWSS3StorageUploadInputStreamOptions)1 AWSS3StorageUploadRequest (com.amplifyframework.storage.s3.request.AWSS3StorageUploadRequest)1 InputStream (java.io.InputStream)1