Connect a Java application to SILO with the MinIO Java SDK.
MinIO Java SDK
SILO implements the S3-compatible server contract, so Java applications can use the upstream MinIO Java SDK directly. The SDK supports Java 8 and later; select a runtime that is also supported by your application framework.
Unlike some other MinIO SDKs, the Java builder accepts a complete endpoint URL, including the http:// or https:// scheme. Keep credentials outside source control.
Create a bucket and upload an object
JAVA
importio.minio.BucketExistsArgs;importio.minio.MakeBucketArgs;importio.minio.MinioClient;importio.minio.PutObjectArgs;importjava.io.ByteArrayInputStream;importjava.nio.charset.StandardCharsets;publicfinalclassQuickstart{privatestaticStringrequired(Stringname){Stringvalue=System.getenv(name);if(value==null||value.isBlank()){thrownewIllegalStateException(name+" is required");}returnvalue;}publicstaticvoidmain(String[]args)throwsException{MinioClientclient=MinioClient.builder().endpoint(required("S3_ENDPOINT")).credentials(required("S3_ACCESS_KEY"),required("S3_SECRET_KEY")).build();Stringbucket="java-quickstart";Stringobject="hello.txt";byte[]payload="hello from SILO\n".getBytes(StandardCharsets.UTF_8);booleanexists=client.bucketExists(BucketExistsArgs.builder().bucket(bucket).build());if(!exists){client.makeBucket(MakeBucketArgs.builder().bucket(bucket).build());}try(ByteArrayInputStreamstream=newByteArrayInputStream(payload)){client.putObject(PutObjectArgs.builder().bucket(bucket).object(object).stream(stream,payload.length,-1).contentType("text/plain").build());}System.out.printf("Uploaded %s: %d bytes%n",object,payload.length);}}
Use the SDK’s Javadoc and maintained examples for presigned URLs, encryption, notifications, object locking, multipart operations, and other APIs.
Production checklist
Use TLS and verify the server certificate and trust store.
Load credentials from a secret manager or protected environment.
Grant the application only the bucket and object permissions it needs.
Pin and test the JDK, SDK, HTTP client, and framework versions together.
Configure timeouts and handle SDK exceptions, retries, streams, and incomplete multipart uploads explicitly.