MinIO Java SDK for Amazon S3 Compatible Cloud Storage Slack

MinIO Java SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.

For a complete list of APIs and examples, please take a look at the Java Client API Reference documentation.

Minimum Requirements

Java 1.8 or above.

Maven usage


Gradle usage

dependencies {

JAR download

The latest JAR can be downloaded from here

Quick Start Example - File Uploader

This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.

You need three items in order to connect to an object storage server.

Parameters Description
Endpoint URL to S3 service.
Access Key Access key (aka user ID) of an account in the S3 service.
Secret Key Secret key (aka password) of an account in the S3 service.

This example uses MinIO server playground Feel free to use this service for test and development.

import io.minio.BucketExistsArgs;
import io.minio.MakeBucketArgs;
import io.minio.MinioClient;
import io.minio.UploadObjectArgs;
import io.minio.errors.MinioException;

public class FileUploader {
  public static void main(String[] args)
      throws IOException, NoSuchAlgorithmException, InvalidKeyException {
    try {
      // Create a minioClient with the MinIO server playground, its access key and secret key.
      MinioClient minioClient =
              .credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")

      // Make 'asiatrip' bucket if not exist.
      boolean found =
      if (!found) {
        // Make a new bucket called 'asiatrip'.
      } else {
        System.out.println("Bucket 'asiatrip' already exists.");

      // Upload '/home/user/Photos/' as object name '' to bucket
      // 'asiatrip'.
          "'/home/user/Photos/' is successfully uploaded as "
              + "object '' to bucket 'asiatrip'.");
    } catch (MinioException e) {
      System.out.println("Error occurred: " + e);
      System.out.println("HTTP trace: " + e.httpTrace());

Compile FileUploader

$ javac -cp minio-8.4.3-all.jar

Run FileUploader

$ java -cp minio-8.4.3-all.jar:. FileUploader
'/home/user/Photos/' is successfully uploaded as object '' to bucket 'asiatrip'.

$ mc ls play/asiatrip/
[2016-06-02 18:10:29 PDT]  82KiB

More References

Explore Further


Please refer Contributors Guide