Zurück zum Ranking

MinIO Client SDK for Java

librariessdkminio-javaclient-sdkaws-s3s3-bucket
Sterne-Wachstum
Sterne
1.3k
Forks
521
Wochenwachstum
Issues
1
5001k
Jan. 2023März 2024Mai 2025Juli 2026
ArtefakteMavengit clone https://github.com/minio/minio-java.git
README

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

<dependency>
    <groupId>io.minio</groupId>
    <artifactId>minio</artifactId>
    <version>9.0.3</version>
</dependency>

Gradle usage

dependencies {
    implementation("io.minio:minio:9.0.3")
}

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 https://play.min.io. Feel free to use this service for test and development.

FileUploader.java

import io.minio.BucketExistsArgs;
import io.minio.MakeBucketArgs;
import io.minio.MinioClient;
import io.minio.UploadObjectArgs;
import io.minio.errors.MinioException;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

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 =
          MinioClient.builder()
              .endpoint("https://play.min.io")
              .credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
              .build();

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

      // Upload '/home/user/Photos/asiaphotos.zip' as object name 'asiaphotos-2015.zip' to bucket
      // 'asiatrip'.
      minioClient.uploadObject(
          UploadObjectArgs.builder()
              .bucket("asiatrip")
              .object("asiaphotos-2015.zip")
              .filename("/home/user/Photos/asiaphotos.zip")
              .build());
      System.out.println(
          "'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
              + "object 'asiaphotos-2015.zip' to bucket 'asiatrip'.");
    } catch (MinioException e) {
      System.out.println("Error occurred: " + e);
      System.out.println("HTTP trace: " + e.httpTrace());
    }
  }
}

Compile FileUploader

$ javac -cp minio-9.0.3-all.jar FileUploader.java

Run FileUploader

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

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

More References

Explore Further

Contribute

Please refer Contributors Guide

Ähnliche Repositories
fffaraz/awesome-cpp

A curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny things. Inspired by awesome-... stuff.

MIT Licensecppcppcon
fffaraz.github.io/awesome-cpp/
72.4k8.3k
microsoft/vcpkg

C++ Library Manager for Windows, Linux, and MacOS

CMakeMIT Licensevcpkgvisual-studio
27.3k7.6k
dexteryy/spellbook-of-modern-webdev

A Big Picture, Thesaurus, and Taxonomy of Modern JavaScript Web Development

javascriptnodejs
17.9k1.3k
platformio/platformio-core

Your Gateway to Embedded Software Development Excellence :alien:

PythonPyPIApache License 2.0iotembedded
platformio.org
9.4k897
rust-embedded/awesome-embedded-rust

Curated list of resources for Embedded and Low-level development in the Rust programming language

Otherawesome-listawesome
8k491
amitshekhariitbhu/Fast-Android-Networking

🚀 A Complete Fast Android Networking Library that also supports HTTP/2 🚀

JavaMavenApache License 2.0httpnetwork
outcomeschool.com
5.9k977
terrakok/kmp-awesome

An awesome list that curates the best Kotlin Multiplatform libraries, tools and more.

kotlinkotlin-multiplatform
5.8k365
flosse/rust-web-framework-comparison

A comparison of some web frameworks and libs written in Rust

Rustcrates.iorustweb
5.8k225
mikepenz/AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose Multiplatform environments

KotlinApache License 2.0aboutlibrariesmikepenz
mikepenz.github.io/AboutLibraries/
4.4k568
roberthein/BouncyLayout

Make. It. Bounce.

SwiftMIT Licensecollectionview
4.2k196
p-ranav/awesome-hpp

A curated list of awesome header-only C++ libraries

The Unlicenseheader-onlyheader-library
4.1k276
roberthein/TinyConstraints

Nothing but sugar.

SwiftMIT Licenseautolayout
4.1k195