Remove files
To delete an object uploaded to S3, use Amplify.Storage.remove
and specify the key:
Amplify.Storage.remove( "myUploadedFileName.txt", result -> Log.i("MyAmplifyApp", "Successfully removed: " + result.getKey()), error -> Log.e("MyAmplifyApp", "Remove failure", error));
Amplify.Storage.remove("myUploadedFileName.txt", { Log.i("MyAmplifyApp", "Successfully removed: ${it.key}") }, { Log.e("MyAmplifyApp", "Remove failure", it) })
try { val result = Amplify.Storage.remove("myUploadedFileName.txt") Log.i("MyAmplifyApp", "Successfully removed: ${result.key}")} catch (error: StorageException) { Log.e("MyAmplifyApp", "Remove failure", error)}
RxAmplify.Storage.remove("myUploadedFileName.txt") .subscribe( result -> Log.i("MyAmplifyApp", "Successfully removed: " + result.getKey()), error -> Log.e("MyAmplifyApp", "Remove failure", error) );