Commit c4bec0d1 by 284718418@qq.com

文件存储地址配置切换

parent 9738f348
...@@ -247,6 +247,18 @@ public class OSSUtil { ...@@ -247,6 +247,18 @@ public class OSSUtil {
return ResultUtil.data(reader, "下载成功"); return ResultUtil.data(reader, "下载成功");
} }
public InputStream downloadFileInputStream(String objectName) {
// 创建OSSClient实例。
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
// ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
OSSObject ossObject = ossClient.getObject(bucketName, objectName);
// 关闭OSSClient。
//ossClient.shutdown();
return ossObject.getObjectContent();
}
/** /**
* 文件输入流批量上传 * 文件输入流批量上传
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment