Search in sources :

Example 1 with AWSS3StoragePluginConfiguration

use of com.amplifyframework.storage.s3.configuration.AWSS3StoragePluginConfiguration 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)

Example 2 with AWSS3StoragePluginConfiguration

use of com.amplifyframework.storage.s3.configuration.AWSS3StoragePluginConfiguration in project amplify-android by aws-amplify.

the class AWSS3StoragePlugin method list.

@NonNull
@Override
public StorageListOperation<?> list(@NonNull String path, @NonNull StorageListOptions options, @NonNull Consumer<StorageListResult> onSuccess, @NonNull Consumer<StorageException> onError) {
    AWSS3StorageListRequest request = new AWSS3StorageListRequest(path, options.getAccessLevel() != null ? options.getAccessLevel() : defaultAccessLevel, options.getTargetIdentityId());
    AWSS3StorageListOperation operation = new AWSS3StorageListOperation(storageService, executorService, cognitoAuthProvider, request, awsS3StoragePluginConfiguration, onSuccess, onError);
    operation.start();
    return operation;
}
Also used : AWSS3StorageListOperation(com.amplifyframework.storage.s3.operation.AWSS3StorageListOperation) AWSS3StorageListRequest(com.amplifyframework.storage.s3.request.AWSS3StorageListRequest) NonNull(androidx.annotation.NonNull)

Example 3 with AWSS3StoragePluginConfiguration

use of com.amplifyframework.storage.s3.configuration.AWSS3StoragePluginConfiguration in project amplify-android by aws-amplify.

the class AWSS3StoragePlugin method getUrl.

@NonNull
@Override
public StorageGetUrlOperation<?> getUrl(@NonNull String key, @NonNull StorageGetUrlOptions options, @NonNull Consumer<StorageGetUrlResult> onSuccess, @NonNull Consumer<StorageException> onError) {
    AWSS3StorageGetPresignedUrlRequest request = new AWSS3StorageGetPresignedUrlRequest(key, options.getAccessLevel() != null ? options.getAccessLevel() : defaultAccessLevel, options.getTargetIdentityId(), options.getExpires() != 0 ? options.getExpires() : defaultUrlExpiration);
    AWSS3StorageGetPresignedUrlOperation operation = new AWSS3StorageGetPresignedUrlOperation(storageService, executorService, cognitoAuthProvider, request, awsS3StoragePluginConfiguration, onSuccess, onError);
    operation.start();
    return operation;
}
Also used : AWSS3StorageGetPresignedUrlOperation(com.amplifyframework.storage.s3.operation.AWSS3StorageGetPresignedUrlOperation) AWSS3StorageGetPresignedUrlRequest(com.amplifyframework.storage.s3.request.AWSS3StorageGetPresignedUrlRequest) NonNull(androidx.annotation.NonNull)

Example 4 with AWSS3StoragePluginConfiguration

use of com.amplifyframework.storage.s3.configuration.AWSS3StoragePluginConfiguration in project amplify-android by aws-amplify.

the class AWSS3StoragePlugin method downloadFile.

@NonNull
@Override
public StorageDownloadFileOperation<?> downloadFile(@NonNull String key, @NonNull File local, @NonNull StorageDownloadFileOptions options, @NonNull Consumer<StorageTransferProgress> onProgress, @NonNull Consumer<StorageDownloadFileResult> onSuccess, @NonNull Consumer<StorageException> onError) {
    AWSS3StorageDownloadFileRequest request = new AWSS3StorageDownloadFileRequest(key, local, options.getAccessLevel() != null ? options.getAccessLevel() : defaultAccessLevel, options.getTargetIdentityId());
    AWSS3StorageDownloadFileOperation operation = new AWSS3StorageDownloadFileOperation(storageService, cognitoAuthProvider, request, awsS3StoragePluginConfiguration, onProgress, onSuccess, onError);
    operation.start();
    return operation;
}
Also used : AWSS3StorageDownloadFileRequest(com.amplifyframework.storage.s3.request.AWSS3StorageDownloadFileRequest) AWSS3StorageDownloadFileOperation(com.amplifyframework.storage.s3.operation.AWSS3StorageDownloadFileOperation) NonNull(androidx.annotation.NonNull)

Example 5 with AWSS3StoragePluginConfiguration

use of com.amplifyframework.storage.s3.configuration.AWSS3StoragePluginConfiguration 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;
}
Also used : AWSS3StorageUploadFileOperation(com.amplifyframework.storage.s3.operation.AWSS3StorageUploadFileOperation) AWSS3StorageUploadRequest(com.amplifyframework.storage.s3.request.AWSS3StorageUploadRequest) File(java.io.File) AWSS3StorageUploadFileOptions(com.amplifyframework.storage.s3.options.AWSS3StorageUploadFileOptions) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)6 AWSS3StorageUploadRequest (com.amplifyframework.storage.s3.request.AWSS3StorageUploadRequest)2 AWSS3StorageDownloadFileOperation (com.amplifyframework.storage.s3.operation.AWSS3StorageDownloadFileOperation)1 AWSS3StorageGetPresignedUrlOperation (com.amplifyframework.storage.s3.operation.AWSS3StorageGetPresignedUrlOperation)1 AWSS3StorageListOperation (com.amplifyframework.storage.s3.operation.AWSS3StorageListOperation)1 AWSS3StorageRemoveOperation (com.amplifyframework.storage.s3.operation.AWSS3StorageRemoveOperation)1 AWSS3StorageUploadFileOperation (com.amplifyframework.storage.s3.operation.AWSS3StorageUploadFileOperation)1 AWSS3StorageUploadInputStreamOperation (com.amplifyframework.storage.s3.operation.AWSS3StorageUploadInputStreamOperation)1 AWSS3StorageUploadFileOptions (com.amplifyframework.storage.s3.options.AWSS3StorageUploadFileOptions)1 AWSS3StorageUploadInputStreamOptions (com.amplifyframework.storage.s3.options.AWSS3StorageUploadInputStreamOptions)1 AWSS3StorageDownloadFileRequest (com.amplifyframework.storage.s3.request.AWSS3StorageDownloadFileRequest)1 AWSS3StorageGetPresignedUrlRequest (com.amplifyframework.storage.s3.request.AWSS3StorageGetPresignedUrlRequest)1 AWSS3StorageListRequest (com.amplifyframework.storage.s3.request.AWSS3StorageListRequest)1 AWSS3StorageRemoveRequest (com.amplifyframework.storage.s3.request.AWSS3StorageRemoveRequest)1 File (java.io.File)1 InputStream (java.io.InputStream)1