Skip to content

Commit

Permalink
cleanup and remove download implementation for follow up PR
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjroach committed Mar 18, 2024
1 parent ac387c8 commit b48dbb3
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import com.amplifyframework.storage.result.StorageUploadInputStreamResult;
import com.amplifyframework.storage.s3.configuration.AWSS3StoragePluginConfiguration;
import com.amplifyframework.storage.s3.operation.AWSS3StorageDownloadFileOperation;
import com.amplifyframework.storage.s3.operation.AWSS3StorageDownloadFileOperationV2;
import com.amplifyframework.storage.s3.operation.AWSS3StorageGetPresignedUrlOperation;
import com.amplifyframework.storage.s3.operation.AWSS3StorageListOperation;
import com.amplifyframework.storage.s3.operation.AWSS3StorageRemoveOperation;
Expand All @@ -67,7 +66,6 @@
import com.amplifyframework.storage.s3.options.AWSS3StorageUploadFileOptions;
import com.amplifyframework.storage.s3.options.AWSS3StorageUploadInputStreamOptions;
import com.amplifyframework.storage.s3.request.AWSS3StorageDownloadFileRequest;
import com.amplifyframework.storage.s3.request.AWSS3StorageDownloadFileRequestV2;
import com.amplifyframework.storage.s3.request.AWSS3StorageGetPresignedUrlRequest;
import com.amplifyframework.storage.s3.request.AWSS3StorageListRequest;
import com.amplifyframework.storage.s3.request.AWSS3StorageRemoveRequest;
Expand Down Expand Up @@ -184,7 +182,7 @@ public String getPluginKey() {
}

@Override
@SuppressWarnings("deprecation") // TODO: Remove once default values are moved to configuration
@SuppressWarnings("deprecation")
public void configure(
JSONObject pluginConfiguration,
@NonNull Context context
Expand Down Expand Up @@ -256,7 +254,6 @@ public String getVersion() {

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageGetUrlOperation<?> getUrl(
@NonNull String key,
@NonNull Consumer<StorageGetUrlResult> onSuccess,
Expand Down Expand Up @@ -324,7 +321,6 @@ public StorageGetUrlOperation<?> getUrl(

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageDownloadFileOperation<?> downloadFile(
@NonNull String key,
@NonNull File local,
Expand All @@ -349,7 +345,6 @@ public StorageDownloadFileOperation<?> downloadFile(

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageDownloadFileOperation<?> downloadFile(
@NonNull String key,
@NonNull File local,
Expand Down Expand Up @@ -421,33 +416,12 @@ public StorageDownloadFileOperation<?> downloadFile(
@NonNull Consumer<StorageDownloadFileResult> onSuccess,
@NonNull Consumer<StorageException> onError
) {
boolean useAccelerateEndpoint =
options instanceof AWSS3StorageDownloadFileOptions &&
((AWSS3StorageDownloadFileOptions) options).useAccelerateEndpoint();

AWSS3StorageDownloadFileRequestV2 request = new AWSS3StorageDownloadFileRequestV2(
path,
local,
useAccelerateEndpoint
);

AWSS3StorageDownloadFileOperationV2 operation = new AWSS3StorageDownloadFileOperationV2(
request,
storageService,
executorService,
authCredentialsProvider,
onProgress,
onSuccess,
onError
);
operation.start();

return operation;
// TODO
return null;
}

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageUploadFileOperation<?> uploadFile(
@NonNull String key,
@NonNull File local,
Expand All @@ -472,7 +446,6 @@ public StorageUploadFileOperation<?> uploadFile(

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageUploadFileOperation<?> uploadFile(
@NonNull String key,
@NonNull File local,
Expand Down Expand Up @@ -554,7 +527,6 @@ public StorageUploadFileOperation<?> uploadFile(

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageUploadInputStreamOperation<?> uploadInputStream(
@NonNull String key,
@NonNull InputStream local,
Expand All @@ -578,7 +550,6 @@ public StorageUploadInputStreamOperation<?> uploadInputStream(

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageUploadInputStreamOperation<?> uploadInputStream(
@NonNull String key,
@NonNull InputStream local,
Expand Down Expand Up @@ -659,7 +630,6 @@ public StorageUploadInputStreamOperation<?> uploadInputStream(

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageRemoveOperation<?> remove(
@NonNull String key,
@NonNull Consumer<StorageRemoveResult> onSuccess,
Expand Down Expand Up @@ -797,7 +767,6 @@ public void getTransfer(

@NonNull
@Override
@SuppressWarnings("deprecation")
public StorageListOperation<?> list(
@NonNull String path,
@NonNull Consumer<StorageListResult> onSuccess,
Expand Down

This file was deleted.

Loading

0 comments on commit b48dbb3

Please sign in to comment.