Skip to content

Commit

Permalink
allow s3Delete to remove all objects from a bucket (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoegertn committed Mar 10, 2018
1 parent ae52e4a commit a6cf4ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -537,6 +537,7 @@ ec2ShareAmi(

## current master
* use `SynchronousNonBlockingStepExecution` for some steps for better error handling
* allow s3Delete to empty bucket (#63)

## 1.24
* Do not fail job on empty change set creation
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/de/taimos/pipeline/aws/S3DeleteStep.java
Expand Up @@ -172,10 +172,14 @@ private void searchObjectsRecursively(AmazonS3 s3Client, List<String> objectsToD
// Create the request to list the objects within it.
ListObjectsRequest request = new ListObjectsRequest();
request.setBucketName(bucket);
request.setPrefix(folder);
request.setDelimiter("/");
if (!folder.endsWith("/")) {

if (folder.equals("/")) {
request.setPrefix(null);
} else if (!folder.endsWith("/")) {
request.setPrefix(folder + "/");
} else {
request.setPrefix(folder);
}

// Get the list of objects within the folder. Because AWS
Expand Down

0 comments on commit a6cf4ac

Please sign in to comment.