Command-line: https://docs.min.io/docs/minio-client-quickstart-guide $ mc aliasset myminio http://192.168.0.223:9000 minioadmin minioadmin
Documentation: https://docs.min.io
WARNING: Console endpoint is listening on a dynamic port (43404), please use --console-address ":PORT" to choose a static port. WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables
publicclassFileUploader { publicstaticvoidmain(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException { try { // Create a minioClient with the MinIO server playground, its access key and secret key. MinioClientminioClient= MinioClient.builder() .endpoint("https://play.min.io") .credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG") .build();
// Make 'asiatrip' bucket if not exist. booleanfound= 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()); } } }