|
|
@@ -44,6 +44,7 @@ public class MinioFileStorageServiceImpl implements MinioFileStorageService {
|
|
|
log.info("初始化MinIO成功");
|
|
|
} catch (Exception e) {
|
|
|
log.error("初始化MinIO失败", e);
|
|
|
+// throw new RuntimeException("初始化MinIO失败");
|
|
|
}
|
|
|
}
|
|
|
@Override
|
|
|
@@ -52,6 +53,7 @@ public class MinioFileStorageServiceImpl implements MinioFileStorageService {
|
|
|
minioClient.removeObject(RemoveObjectArgs.builder().bucket(minIOConfigProperties.getBucket()).object(fileName).build());
|
|
|
} catch (Exception e) {
|
|
|
log.error("删除文件失败", e);
|
|
|
+// throw new RuntimeException("删除文件失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -75,6 +77,7 @@ public class MinioFileStorageServiceImpl implements MinioFileStorageService {
|
|
|
out.close();
|
|
|
} catch (Exception e) {
|
|
|
log.error("下载文件失败", e);
|
|
|
+ throw new RuntimeException("下载文件失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -98,6 +101,7 @@ public class MinioFileStorageServiceImpl implements MinioFileStorageService {
|
|
|
);
|
|
|
} catch (Exception e) {
|
|
|
log.error("上传文件失败", e);
|
|
|
+ throw new Exception("上传文件失败");
|
|
|
}
|
|
|
return filePath;
|
|
|
}
|
|
|
@@ -114,6 +118,9 @@ public class MinioFileStorageServiceImpl implements MinioFileStorageService {
|
|
|
.stream(inputStream, file.length(), ObjectWriteArgs.MIN_MULTIPART_SIZE)
|
|
|
.build()
|
|
|
);
|
|
|
+ }catch (Exception e) {
|
|
|
+ log.error("上传文件失败", e);
|
|
|
+ throw new Exception("上传文件失败");
|
|
|
}
|
|
|
return filePath;
|
|
|
}
|
|
|
@@ -150,6 +157,7 @@ public class MinioFileStorageServiceImpl implements MinioFileStorageService {
|
|
|
resList.add(s);
|
|
|
}catch (Exception e){
|
|
|
log.error("上传文件失败", e);
|
|
|
+ throw new RuntimeException("上传文件失败");
|
|
|
}
|
|
|
});
|
|
|
return resList;
|