fix(文档拆分): MinioUtil -> ObsBootUtil
This commit is contained in:
+5
-4
@@ -1,7 +1,7 @@
|
||||
package com.jero.modules.oss.controller;
|
||||
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.MinioUtil;
|
||||
import com.jero.common.util.obs.ObsBootUtil;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.oss.util.SplitFileUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -36,9 +36,10 @@ public class SplitFileController {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=\"" + SplitFileUtils.encodeFileName(fileName, request) + "\"");
|
||||
response.setContentType("application/force-download");
|
||||
if (MinioUtil.doesObjectExist(fileUrl)) {
|
||||
// if (MinioUtil.doesObjectExist(fileUrl)) {
|
||||
try (OutputStream os = response.getOutputStream();
|
||||
InputStream fis = MinioUtil.download(fileUrl)) {
|
||||
// InputStream fis = MinioUtil.download(fileUrl)) {
|
||||
InputStream fis = ObsBootUtil.getOssFile(fileUrl)) {
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
os.write(len);
|
||||
@@ -49,7 +50,7 @@ public class SplitFileController {
|
||||
} catch (IOException e) {
|
||||
throw new JeroBootException("文件不存在");
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user