<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>0.2.2</version>
</dependency>dependencies {
compile 'io.minio:minio:0.2.2'
}You can download the latest jars directly from maven -
package hello.listbuckets;
import io.minio.MinioClient;
import io.minio.errors.ClientException;
import io.minio.messages.ListAllMyBucketsResult;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
public class HelloListBuckets {
public static void main(String[] args) throws IOException, XmlPullParserException, ClientException {
// Set s3 endpoint, region is calculated automatically
Client s3client = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY");
// list buckets
Iterator<Bucket> bucketList = s3Client.listBuckets();
while (bucketList.hasNext()) {
Bucket bucket = bucketList.next();
System.out.println(bucket.getName());
}
}
}