类 MinioUtil

java.lang.Object
com.mbap.upload.utils.minio.MinioUtil

@Service public class MinioUtil extends Object
Minio工具类
作者:
BW.Panda Mar 10, 2020
  • 构造器详细资料

    • MinioUtil

      public MinioUtil()
  • 方法详细资料

    • getBucketName

      public String getBucketName()
      返回bucketName
      返回:
      String
    • upload

      public void upload(InputStream inputStream, String objectName, long size, String contentType)
      上传文件到minio中
      参数:
      inputStream - stream to upload.
      objectName - Object name to create in the bucket.
      size - Size of all the data that will be uploaded.
      contentType - Content type of the stream.
    • preview

      public String preview(String fileName, String bucketName)
      预览图片
      参数:
      fileName -
      返回:
    • download

      public InputStream download(String bucketName, String objectName)
      下载文件,返回stream. The InputStream must be closed after use else the connection will remain open.
      参数:
      objectName - Object name to create in the bucket.
      返回:
      InputStream
    • delete

      public void delete(String bucketName, String objectName)
      删除文件
      参数:
      objectName - Object name to create in the bucket.