|
|
@@ -130,6 +130,11 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
|
|
|
String bucketName = url.substring(0, url.indexOf("/"));
|
|
|
String fileName = url.substring(url.indexOf("/") + 1);
|
|
|
|
|
|
+ List<S3ObjectSummary> objects = fileTemplate.getAllObjectsByPrefix(bucketName, fileName, false);
|
|
|
+ if (objects.isEmpty()) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
//s3Object会自动关闭,所以需要复制流
|
|
|
try (S3Object s3Object = fileTemplate.getObject(bucketName, fileName);
|
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|