io.minio
minio
3.0.10
调用 WebCompressUtil工具在线解压代码示例
============= 《大厂前端面试题解析+Web核心总结学习笔记+企业项目实战源码+最新高清讲解视频》无偿开源 徽信搜索公众号【编程进阶路】 ===============
MinioClient minioClient = new MinioClient(endpoint, accessKey, secretKey);
// 检查存储桶是否已经存在
boolean isExist = minioClient.bucketExists(bucketName);
if (!isExist) {
minioClient.makeBucket(bucketName);
}
// 拼接文件名
String parentDir = genParentDir();
String objectName = parentDir + file.getOriginalFilename();
try {
// 使用putObject上传一个文件到存储桶中。
minioClient.putObject(bucketName, objectName, file.getInputStream(), file.getSize(), null, null, file.getContentType());
} catch (Exception e) {
e.printStackTrace();
}
Strin