use of com.amplifyframework.storage.s3.service.StorageService in project amplify-android by aws-amplify.
the class AWSS3StoragePlugin method uploadFile.
@NonNull
@Override
public StorageUploadFileOperation<?> uploadFile(@NonNull String key, @NonNull File local, @NonNull StorageUploadFileOptions options, @NonNull Consumer<StorageTransferProgress> onProgress, @NonNull Consumer<StorageUploadFileResult> onSuccess, @NonNull Consumer<StorageException> onError) {
AWSS3StorageUploadRequest<File> request = new AWSS3StorageUploadRequest<>(key, local, options.getAccessLevel() != null ? options.getAccessLevel() : defaultAccessLevel, options.getTargetIdentityId(), options.getContentType(), options instanceof AWSS3StorageUploadFileOptions ? ((AWSS3StorageUploadFileOptions) options).getServerSideEncryption() : ServerSideEncryption.NONE, options.getMetadata());
AWSS3StorageUploadFileOperation operation = new AWSS3StorageUploadFileOperation(storageService, cognitoAuthProvider, request, awsS3StoragePluginConfiguration, onProgress, onSuccess, onError);
operation.start();
return operation;
}
use of com.amplifyframework.storage.s3.service.StorageService in project amplify-android by aws-amplify.
the class AWSS3StoragePlugin method remove.
@NonNull
@Override
public StorageRemoveOperation<?> remove(@NonNull String key, @NonNull StorageRemoveOptions options, @NonNull Consumer<StorageRemoveResult> onSuccess, @NonNull Consumer<StorageException> onError) {
AWSS3StorageRemoveRequest request = new AWSS3StorageRemoveRequest(key, options.getAccessLevel() != null ? options.getAccessLevel() : defaultAccessLevel, options.getTargetIdentityId());
AWSS3StorageRemoveOperation operation = new AWSS3StorageRemoveOperation(storageService, executorService, cognitoAuthProvider, request, awsS3StoragePluginConfiguration, onSuccess, onError);
operation.start();
return operation;
}
Aggregations