The Minio JAVA SDK documentation doesn't clearly articulate how to create a folder inside a bucket.
Can somebody help me on this request ?
Thanks in Advance!
In the objectName parameter prefix of the putObject method, you can specify a folder name. https://docs.minio.io/docs/java-client-api-reference#putObject https://github.com/minio/minio/issues/2423#issuecomment-239408168
For example:
//objectName = folderName + "/" + fileName;
minioClient.putObject(bucketName, objectName, inputStream, contentType);
Create the bucket if its not present. To add folder within it add it to the name of file. Eg. File name: "sample.txt", Bucket Name: "main", SubFolder: "resrc" filePath: file which you want to upload
minioClient.putObject("main", "resrc" + "/" + "sample.txt", filePath);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With