Skip to content

Commit e84187b

Browse files
balamuruganaharshavardhana
authored andcommitted
examples: update all examples using play.minio.io (#484)
1 parent b9299e0 commit e84187b

19 files changed

+152
-95
lines changed

examples/BucketExists.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525

2626
public class BucketExists {
2727
/**
28-
* main().
28+
* MinioClient.bucketExists() example.
2929
*/
3030
public static void main(String[] args)
3131
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
32-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
33-
// dummy values, please replace them with original values.
34-
// For Amazon S3 endpoint, region is calculated automatically
3532
try {
36-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
33+
/* play.minio.io for test and development. */
34+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
35+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
36+
37+
/* Amazon S3: */
38+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
39+
// "YOUR-SECRETACCESSKEY");
3740

3841
// Check whether 'my-bucketname' exist or not.
3942
boolean found = minioClient.bucketExists("my-bucketname");

examples/DownloadObject.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525

2626
public class DownloadObject {
2727
/**
28-
* main().
28+
* MinioClient.getObject() example.
2929
*/
3030
public static void main(String[] args)
3131
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
32-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
33-
// dummy values, please replace them with original values.
34-
// For Amazon S3 endpoint, region is calculated automatically
3532
try {
36-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
33+
/* play.minio.io for test and development. */
34+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
35+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
36+
37+
/* Amazon S3: */
38+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
39+
// "YOUR-SECRETACCESSKEY");
3740

3841
// Check whether the object exists using statObject(). If the object is not found,
3942
// statObject() throws an exception. It means that the object exists when statObject()

examples/GetBucketPolicy.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,18 @@
2626

2727
public class GetBucketPolicy {
2828
/**
29-
* main().
29+
* MinioClient.getBucketPolicy() example.
3030
*/
3131
public static void main(String[] args)
3232
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
33-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
34-
// dummy values, please replace them with original values.
35-
// For Amazon S3 endpoint, region is calculated automatically
3633
try {
37-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
34+
/* play.minio.io for test and development. */
35+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
36+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
37+
38+
/* Amazon S3: */
39+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
40+
// "YOUR-SECRETACCESSKEY");
3841

3942
PolicyType policy = minioClient.getBucketPolicy("my-bucketname", "downloads");
4043
System.out.println("Current policy: " + policy.toString());

examples/GetObject.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,18 @@
2828

2929
public class GetObject {
3030
/**
31-
* main().
31+
* MinioClient.getObject() example.
3232
*/
3333
public static void main(String[] args)
3434
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
35-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
36-
// dummy values, please replace them with original values.
37-
// For Amazon S3 endpoint, region is calculated automatically
3835
try {
39-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
36+
/* play.minio.io for test and development. */
37+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
38+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
39+
40+
/* Amazon S3: */
41+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
42+
// "YOUR-SECRETACCESSKEY");
4043

4144
// Check whether the object exists using statObject(). If the object is not found,
4245
// statObject() throws an exception. It means that the object exists when statObject()

examples/GetPartialObject.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,18 @@
2828

2929
public class GetPartialObject {
3030
/**
31-
* main().
31+
* MinioClient.getObject() example.
3232
*/
3333
public static void main(String[] args)
3434
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
35-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
36-
// dummy values, please replace them with original values.
37-
// For Amazon S3 endpoint, region is calculated automatically
3835
try {
39-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
36+
/* play.minio.io for test and development. */
37+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
38+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
39+
40+
/* Amazon S3: */
41+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
42+
// "YOUR-SECRETACCESSKEY");
4043

4144
// Check whether the object exists using statObject(). If the object is not found,
4245
// statObject() throws an exception. It means that the object exists when statObject()

examples/ListBuckets.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@
2727

2828
public class ListBuckets {
2929
/**
30-
* main().
30+
* MinioClient.listBuckets() example.
3131
*/
3232
public static void main(String[] args)
3333
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
34-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
35-
// dummy values, please replace them with original values.
36-
// For Amazon S3 endpoint, region is calculated automatically
3734
try {
38-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
35+
/* play.minio.io for test and development. */
36+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
37+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
38+
39+
/* Amazon S3: */
40+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
41+
// "YOUR-SECRETACCESSKEY");
3942

4043
// List buckets we have atleast read access.
4144
List<Bucket> bucketList = minioClient.listBuckets();

examples/ListIncompleteUploads.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@
2727

2828
public class ListIncompleteUploads {
2929
/**
30-
* main().
30+
* MinioClient.listIncompleteUploads() example.
3131
*/
3232
public static void main(String[] args)
3333
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
34-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
35-
// dummy values, please replace them with original values.
36-
// For Amazon S3 endpoint, region is calculated automatically
3734
try {
38-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
35+
/* play.minio.io for test and development. */
36+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
37+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
38+
39+
/* Amazon S3: */
40+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
41+
// "YOUR-SECRETACCESSKEY");
3942

4043
// Check whether 'my-bucketname' exist or not.
4144
boolean found = minioClient.bucketExists("my-bucketname");

examples/ListObjects.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@
2727

2828
public class ListObjects {
2929
/**
30-
* main().
30+
* MinioClient.listObjects() example.
3131
*/
3232
public static void main(String[] args)
3333
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
34-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
35-
// dummy values, please replace them with original values.
36-
// For Amazon S3 endpoint, region is calculated automatically
3734
try {
38-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
35+
/* play.minio.io for test and development. */
36+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
37+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
38+
39+
/* Amazon S3: */
40+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
41+
// "YOUR-SECRETACCESSKEY");
3942

4043
// Check whether 'my-bucketname' exist or not.
4144
boolean found = minioClient.bucketExists("my-bucketname");

examples/MakeBucket.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525

2626
public class MakeBucket {
2727
/**
28-
* main().
28+
* MinioClient.makeBucket() example.
2929
*/
3030
public static void main(String[] args)
3131
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
32-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
33-
// dummy values, please replace them with original values.
34-
// For Amazon S3 endpoint, region is calculated automatically
3532
try {
36-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
33+
/* play.minio.io for test and development. */
34+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
35+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
36+
37+
/* Amazon S3: */
38+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
39+
// "YOUR-SECRETACCESSKEY");
3740

3841
// Create bucket if it doesn't exist.
3942
boolean found = minioClient.bucketExists("my-bucketname");

examples/PresignedGetObject.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525

2626
public class PresignedGetObject {
2727
/**
28-
* main().
28+
* MinioClient.presignedGetObject() example.
2929
*/
3030
public static void main(String[] args)
3131
throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
32-
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are
33-
// dummy values, please replace them with original values.
34-
// For Amazon S3 endpoint, region is calculated automatically
3532
try {
36-
MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
33+
/* play.minio.io for test and development. */
34+
MinioClient minioClient = new MinioClient("http://play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F",
35+
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
36+
37+
/* Amazon S3: */
38+
// MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
39+
// "YOUR-SECRETACCESSKEY");
3740

3841
// Get presigned URL string to download 'my-objectname' in 'my-bucketname' and its life time is one day.
3942
String url = minioClient.presignedGetObject("my-bucketname", "my-objectname", 60 * 60 * 24);

0 commit comments

Comments
 (0)