package io.findify.s3mock.example;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.AnonymousAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Builder;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import io.findify.s3mock.S3Mock;

/**
 * Created by shutty on 5/23/17.
 */
public class JavaBuilderExample {
    public static void main(String[] args) {
        S3Mock api = new S3Mock.Builder().withPort(8001).withInMemoryBackend().build();
        api.start();
        AmazonS3 client = AmazonS3ClientBuilder
                .standard()
                .withPathStyleAccessEnabled(true)
                .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("http://localhost:8001", "us-east-1"))
                .withCredentials(new AWSStaticCredentialsProvider(new AnonymousAWSCredentials()))
                .build();
        client.createBucket("testbucket");
        client.putObject("testbucket", "file/name", "contents");
    }

}

@@ -384,24 +384,85 @@
 entBuilder;%0A
+import com.amazonaws.services.s3.model.DeleteObjectsRequest;%0A
 import io.fi
@@ -1174,17 +1174,17 @@
 %22, %22file
-/
+%5E
 name%22, %22
@@ -1191,21 +1191,113 @@
 contents%22);%0A
+        client.deleteObjects(new DeleteObjectsRequest(%22testbucket%22).withKeys(%22file%5Ename%22));%0A
     %7D%0A%0A%7D%0A

call deleteObjects in JavaBuilderExample