Skip to content

Commit 7589531

Browse files
committed
Added Java examples
1 parent 75eeb0c commit 7589531

10 files changed

Lines changed: 664 additions & 0 deletions

File tree

s3-java/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin

s3-java/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Instructions
2+
3+
First, persist your credentials in `~/.aws/credentials` as described in the AWS best practices for persisting credentials, e.g.,
4+
```
5+
user@host::~> cat ~/.aws/credentials
6+
7+
[my_profile]
8+
aws_access_key_id = 3LXXXXXXXXXXXX
9+
aws_secret_access_key = nuPXXXXXXXXXXXXXXXXXXXXX
10+
```
11+
To execute the code example, first adjust the address of the StorageGRID Webscale API Gateway. Then execute:
12+
```
13+
$ ./gradlew run
14+
```
15+
This will automatically download Gradle and the required libraries. Then, it will compile and execute the example code.
16+
17+
To generate an Eclipse project file, use:
18+
```
19+
$ ./gradlew eclipse
20+
```
21+
and then choose `File -> Import` in Eclipse, and import the `s3-java` folder.
22+
23+
To run the tests (i.e., to validate other version of the used AWS SDK), run:
24+
```
25+
$ ./gradlew test
26+
```
27+
28+
# Notes
29+
30+
The provided acceptence tests are a quick shot for making sure, that basic functionality works.

s3-java/build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apply plugin: 'java'
2+
apply plugin: 'application'
3+
apply plugin: 'eclipse'
4+
5+
sourceCompatibility = 1.7
6+
version = '1.0'
7+
mainClassName = 'codeexamples.Examples'
8+
9+
// This flag disable SSL Certificate Verification - do not use in production!
10+
applicationDefaultJvmArgs = ["-Dcom.amazonaws.sdk.disableCertChecking=1"]
11+
12+
eclipse {
13+
project {
14+
name = 'sg-java-example'
15+
}
16+
}
17+
18+
test {
19+
jvmArgs '-Dcom.amazonaws.sdk.disableCertChecking=1'
20+
}
21+
22+
repositories {
23+
mavenCentral()
24+
}
25+
26+
dependencies {
27+
compile 'com.amazonaws:aws-java-sdk-s3:1.10.35'
28+
compile 'commons-io:commons-io:2.4'
29+
testCompile 'junit:junit:4.11'
30+
}
31+
32+
task wrapper(type: Wrapper) {
33+
gradleVersion = '2.3'
34+
}
35+
49.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Mar 04 12:01:17 CET 2015
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=http\://services.gradle.org/distributions/gradle-2.3-bin.zip

s3-java/gradlew

Lines changed: 164 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

s3-java/gradlew.bat

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)