This is an example program to reproduce the issue described in:
It does the followings:
- Create a bucket with a given bucket name if not present.
- Put an object with key "key1" to the bucket using a wrong content length.
- Put an object with key "key2" to the bucket using the correct content length.
- A Java SDK
- Linux, macOS or Windows. (Not tested on Windows)
- An Internet connection
Build and run the program by the following commands:
## Linux or macOS
# Run the tool using the default HTTPS (443) protocol.
$ ./gradlew run --args='--bucket mybucket'
# Runt the tool using HTTP (80) protocol.
$ ./gradlew run --args='--bucket mybucket -H'
Edit app/src/main/java/chunk/tester/App.java
and change the REGION
and
HTTP_ENDPOINT
.
// Asia Pacific (Tokyo)
private static final String REGION = "ap-northeast-1";
// Endpoint URL
// See: https://docs.aws.amazon.com/general/latest/gr/s3.html
private static final String HTTP_ENDPOINT = "http://s3.ap-northeast-1.amazonaws.com";
Edit app/build.gradle
and change the awsSdkVersion
.
// The version of the AWS SDK for Java.
def awsSdkVersion = '2.17.122'