类 MinioUtil
java.lang.Object
org.anyline.mimio.util.MinioUtil
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明composeObject(String bucket, List<String> chunks, String target) 合并文件composeObject(List<String> chunks, String target) voidcreateBucket(String bucket) 创建bucketList<io.minio.messages.Bucket>获取全部bucketList<io.minio.messages.Item>getAllObjectsByPrefix(String prefix, boolean recursive) List<io.minio.messages.Item>getAllObjectsByPrefix(String bucket, String prefix, boolean recursive) 根据文件前置查询文件Optional<io.minio.messages.Bucket>根据bucket获取信息io.minio.MinioClientstatic MinioUtilstatic MinioUtilgetInstance(String key) 获取文件io.minio.StatObjectResponsegetObjectInfo(String obj) io.minio.StatObjectResponsegetObjectInfo(String bucket, String obj) 获取文件信息getObjectURL(String obj) getObjectURL(String bucket, String obj) 获取文件外链 getObjectURL("alcdn","a/b.txt") 返回一个urlpresignedUrl(String obj) presignedUrl(String bucket, String obj) 获取直传链接putObject(String obj, InputStream stream, Long size) 上传文件 utObject("alcdn","a/b.txt",new File("D:\\a.txt"));putObject(String bucket, String obj, InputStream stream, Long size) 分区上传文件上传文件 base64voidremoveBucket(String bucket) 根据bucket删除信息voidremoveObject(String obj) voidremoveObject(String bucket, String obj) 删除文件voidsetClient(io.minio.MinioClient client) voidsetConfig(MinioConfig config)
-
构造器详细资料
-
MinioUtil
public MinioUtil() -
MinioUtil
-
-
方法详细资料
-
getInstances
-
getInstance
-
getClient
public io.minio.MinioClient getClient() -
setClient
public void setClient(io.minio.MinioClient client) -
getConfig
-
setConfig
-
getInstance
-
createBucket
创建bucket- 参数:
bucket- bucket名称- 抛出:
Exception- 异常 Exception
-
getAllBuckets
获取全部bucket- 返回:
- List https://docs.minio.io/cn/java-client-api-reference.html#listBuckets
- 抛出:
Exception- 异常 Exception
-
getBucket
根据bucket获取信息- 参数:
bucket- bucket名称- 返回:
- Optional
- 抛出:
Exception- 异常 Exception
-
removeBucket
根据bucket删除信息- 参数:
bucket- bucket名称- 抛出:
Exception- 异常 Exception
-
putObject
分区上传文件- 参数:
bucket- bucket名称obj- 文件名称stream- 文件流size- 文件大小- 返回:
- String
- 抛出:
Exception- 异常 Exception
-
putObject
- 抛出:
Exception
-
getAllObjectsByPrefix
public List<io.minio.messages.Item> getAllObjectsByPrefix(String bucket, String prefix, boolean recursive) throws Exception 根据文件前置查询文件- 参数:
bucket- bucket名称prefix- 前缀recursive- 是否递归查询- 返回:
- MinioItem 列表
- 抛出:
Exception- 异常 Exception
-
getAllObjectsByPrefix
public List<io.minio.messages.Item> getAllObjectsByPrefix(String prefix, boolean recursive) throws Exception - 抛出:
Exception
-
getObjectURL
获取文件外链 getObjectURL("alcdn","a/b.txt") 返回一个url- 参数:
bucket- bucket名称obj- 文件名称- 返回:
- url
- 抛出:
Exception- 异常 Exception
-
getObjectURL
- 抛出:
Exception
-
getObject
获取文件- 参数:
bucket- bucket名称obj- 文件名称- 返回:
- InputStream
- 抛出:
Exception- 异常 Exception
-
getObject
- 抛出:
Exception
-
putObject
上传文件 base64- 参数:
bucket- bucket名称obj- 文件名称base64- 文件base64- 返回:
- String
- 抛出:
Exception- 异常 Exception
-
putObject
- 抛出:
Exception
-
putObject
上传文件 utObject("alcdn","a/b.txt",new File("D:\\a.txt"));- 参数:
bucket- bucket名称obj- 文件名称file- 文件- 返回:
- String
- 抛出:
Exception- 异常 Exception
-
putObject
- 抛出:
Exception
-
getObjectInfo
获取文件信息- 参数:
bucket- bucket名称obj- 文件名称- 返回:
- StatObjectResponse
- 抛出:
Exception- 异常 https://docs.minio.io/cn/java-client-api-reference.html#statObject
-
getObjectInfo
- 抛出:
Exception
-
removeObject
删除文件- 参数:
bucket- bucket名称obj- 文件名称- 抛出:
Exception- 异常 https://docs.minio.io/cn/java-client-api-reference.html#removeObject
-
removeObject
- 抛出:
Exception
-
presignedUrl
获取直传链接 -
presignedUrl
- 抛出:
Exception
-
composeObject
合并文件- 参数:
bucket- bucketchunks- chunkstarget- target- 返回:
- String
- 抛出:
Exception- 异常 Exception
-
composeObject
- 抛出:
Exception
-