From 19d52eb91456f069debc2433598f5c5d386d0e2b Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Thu, 10 Aug 2023 14:43:50 +0800 Subject: [PATCH 1/8] =?UTF-8?q?Fix=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" | 2 +- "docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git "a/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" "b/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" index d9b5b183..a3337567 100644 --- "a/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" +++ "b/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" @@ -391,7 +391,7 @@ public class HuaweiObsFileStorageClientFactory implements FileStorageClientFacto > [!TIP|label:小提示:] > 1. FTP 和 SFTP 就是通过 Client 工厂类和对象池配合来提升性能的,具体可以查看相关源码 > -> 2. 如果自定义的存储平台比较简单,也可以不用工厂类直接在存储平台中创建 Client 对象, `0.8.0` 之前的版本就是这种方式 +> 2. 如果自定义的存储平台比较简单,也可以不用工厂类直接在存储平台中创建 Client 对象, `1.0.0` 之前的版本就是这种方式 > > 3. 如果自带的 Client 工厂类满足不了你的需求,例如想添加网络代理,只要自定义一个 Client 工厂类就可以了,不用重新自定义整个存储平台,在后续文档中会详细说明 diff --git "a/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" "b/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" index 5452b850..8af402f0 100644 --- "a/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" +++ "b/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" @@ -1,7 +1,7 @@ # 更新记录 ## 1.0.2 -2023-08-08 +2023-08-09 - 修复了华为云 OBS 未加载的问题 ## 1.0.1 From c35ee3466bb55c348e9eb5f4e080111f6ac5b696 Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Fri, 11 Aug 2023 14:04:09 +0800 Subject: [PATCH 2/8] =?UTF-8?q?Fix=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" "b/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" index a3337567..4c31b78b 100644 --- "a/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" +++ "b/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" @@ -467,7 +467,7 @@ spring: @Bean public List> myHuaweiObsFileStorageClientFactory(SpringFileStorageProperties properties) { return properties.getHuaweiObs().stream() - .filter(SpringHuaweiObsConfigConfig::getEnableStorage) + .filter(SpringHuaweiObsConfig::getEnableStorage) .map(config -> new FileStorageClientFactory() { private volatile ObsClient client; From c8cb827146e50223a3394af402eb3a6698aff537 Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Thu, 17 Aug 2023 15:47:27 +0800 Subject: [PATCH 3/8] =?UTF-8?q?Fix=20FileStorageClientFactory=20=E6=9C=AA?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8A=A0=E8=BD=BD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/storage/spring/FileStorageAutoConfiguration.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-file-storage/src/main/java/cn/xuyanwu/spring/file/storage/spring/FileStorageAutoConfiguration.java b/spring-file-storage/src/main/java/cn/xuyanwu/spring/file/storage/spring/FileStorageAutoConfiguration.java index 01178a89..7ff4393c 100644 --- a/spring-file-storage/src/main/java/cn/xuyanwu/spring/file/storage/spring/FileStorageAutoConfiguration.java +++ b/spring-file-storage/src/main/java/cn/xuyanwu/spring/file/storage/spring/FileStorageAutoConfiguration.java @@ -5,6 +5,7 @@ import cn.xuyanwu.spring.file.storage.aspect.FileStorageAspect; import cn.xuyanwu.spring.file.storage.file.FileWrapperAdapter; import cn.xuyanwu.spring.file.storage.platform.FileStorage; +import cn.xuyanwu.spring.file.storage.platform.FileStorageClientFactory; import cn.xuyanwu.spring.file.storage.recorder.DefaultFileRecorder; import cn.xuyanwu.spring.file.storage.recorder.FileRecorder; import cn.xuyanwu.spring.file.storage.spring.file.MultipartFileWrapperAdapter; @@ -93,13 +94,15 @@ public FileStorageService fileStorageService(FileRecorder fileRecorder, List> fileStorageLists, List aspectList, List fileWrapperAdapterList, - ContentTypeDetect contentTypeDetect) { + ContentTypeDetect contentTypeDetect, + List>> clientFactoryList) { FileStorageServiceBuilder builder = FileStorageServiceBuilder.create(properties.toFileStorageProperties()) .setFileRecorder(fileRecorder) .setAspectList(aspectList) .setContentTypeDetect(contentTypeDetect) - .setFileWrapperAdapterList(fileWrapperAdapterList); + .setFileWrapperAdapterList(fileWrapperAdapterList) + .setClientFactoryList(clientFactoryList); fileStorageLists.forEach(builder::addFileStorage); From 28f5e8f4de0ab5c15de2c227f44afd66ce4dc180 Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Thu, 17 Aug 2023 16:47:26 +0800 Subject: [PATCH 4/8] =?UTF-8?q?Update=20=E4=BC=98=E5=8C=96=20HuaweiObsFile?= =?UTF-8?q?Storage=20=E7=9A=84=20ACL=20=E8=BD=AC=E6=8D=A2=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spring/file/storage/platform/HuaweiObsFileStorage.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/HuaweiObsFileStorage.java b/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/HuaweiObsFileStorage.java index 360f9e62..dc828e2e 100644 --- a/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/HuaweiObsFileStorage.java +++ b/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/HuaweiObsFileStorage.java @@ -1,7 +1,6 @@ package cn.xuyanwu.spring.file.storage.platform; import cn.hutool.core.io.IoUtil; -import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import cn.xuyanwu.spring.file.storage.FileInfo; import cn.xuyanwu.spring.file.storage.FileStorageProperties.HuaweiObsConfig; @@ -9,7 +8,7 @@ import cn.xuyanwu.spring.file.storage.UploadPretreatment; import cn.xuyanwu.spring.file.storage.exception.FileStorageRuntimeException; import com.obs.services.ObsClient; -import com.obs.services.internal.IConvertor; +import com.obs.services.internal.ObsConvertor; import com.obs.services.model.*; import lombok.Getter; import lombok.NoArgsConstructor; @@ -158,8 +157,8 @@ public AccessControlList getAcl(Object acl) { } else if (acl instanceof String || acl == null) { String sAcl = (String) acl; if (StrUtil.isEmpty(sAcl)) sAcl = defaultAcl; - IConvertor convertor = ReflectUtil.invoke(getClient(),"getIConvertor",bucketName); - return convertor.transCannedAcl(sAcl); + if (sAcl == null) return null; + return ObsConvertor.getInstance().transCannedAcl(sAcl); } else { throw new FileStorageRuntimeException("不支持的ACL:" + acl); } From e7b6555fa13878d8e6cc16f2bbc46ff50321f944 Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Thu, 17 Aug 2023 16:54:13 +0800 Subject: [PATCH 5/8] =?UTF-8?q?Fix=20=E4=BF=AE=E5=A4=8D=20GoogleCloudStora?= =?UTF-8?q?geFileStorage=20=E7=9A=84=20ACL=20=E8=BD=AC=E6=8D=A2=E6=97=B6?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/storage/platform/GoogleCloudStorageFileStorage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/GoogleCloudStorageFileStorage.java b/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/GoogleCloudStorageFileStorage.java index 1fe3513a..01d03643 100644 --- a/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/GoogleCloudStorageFileStorage.java +++ b/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/GoogleCloudStorageFileStorage.java @@ -130,8 +130,10 @@ public AclWrapper getAcl(Object acl) { } else if (acl instanceof String || acl == null) { String sAcl = (String) acl; if (StrUtil.isEmpty(sAcl)) sAcl = defaultAcl; + if (StrUtil.isEmpty(sAcl)) return null; + sAcl = sAcl.replace("-","_"); for (PredefinedAcl item : PredefinedAcl.values()) { - if (item.toString().equalsIgnoreCase(sAcl.replace("-","_"))) { + if (item.toString().equalsIgnoreCase(sAcl)) { return new AclWrapper(item); } } From d23be9d903ec575d3cc33507f96c18a3e56f445c Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Thu, 17 Aug 2023 16:58:18 +0800 Subject: [PATCH 6/8] =?UTF-8?q?Fix=20=E4=BF=AE=E5=A4=8D=20=E5=8F=88?= =?UTF-8?q?=E6=8B=8D=E4=BA=91=20USS=20=E7=9A=84=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spring/file/storage/platform/UpyunUssFileStorage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/UpyunUssFileStorage.java b/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/UpyunUssFileStorage.java index d03d064d..e6028d89 100644 --- a/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/UpyunUssFileStorage.java +++ b/file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/UpyunUssFileStorage.java @@ -69,7 +69,7 @@ public boolean save(FileInfo fileInfo,UploadPretreatment pre) { String newFileKey = getFileKey(fileInfo); fileInfo.setUrl(domain + newFileKey); if (fileInfo.getFileAcl() != null) { - throw new FileStorageRuntimeException("文件上传失败,七牛云 Kodo 不支持设置 ACL!platform:" + platform + ",filename:" + fileInfo.getOriginalFilename()); + throw new FileStorageRuntimeException("文件上传失败,又拍云 USS 不支持设置 ACL!platform:" + platform + ",filename:" + fileInfo.getOriginalFilename()); } ProgressListener listener = pre.getProgressListener(); From 26cadbb59d96b6475af98c7be35e8169043528a3 Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Thu, 17 Aug 2023 17:11:35 +0800 Subject: [PATCH 7/8] Release 1.0.3 --- README.md | 2 ++ docs/README.md | 2 ++ docs/_navbar.md | 4 +++- "docs/\345\277\253\351\200\237\345\205\245\351\227\250.md" | 2 +- "docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" | 7 +++++++ ...oot\345\215\225\347\213\254\344\275\277\347\224\250.md" | 2 +- file-storage-core/pom.xml | 4 ++-- pom.xml | 4 ++-- spring-file-storage-test/pom.xml | 4 ++-- spring-file-storage/pom.xml | 2 +- 10 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 35987470..b09503b6 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ Amazon S3、GoogleCloud Storage、金山云 KS3、美团云 MSS、京东云 OSS 后续即将支持 Samba、NFS +`1.0.3` 修复了 FileStorageClientFactory 未自动加载等问题,查看 [更新记录](https://spring-file-storage.xuyanwu.cn/#/更新记录?id=103) +
`1.0.2` 修复了华为云 OBS 未加载的问题,查看 [更新记录](https://spring-file-storage.xuyanwu.cn/#/更新记录?id=102)
`1.0.1` 修复了 MultipartFile 无法正确获取文件名等问题,查看 [更新记录](https://spring-file-storage.xuyanwu.cn/#/更新记录?id=101) diff --git a/docs/README.md b/docs/README.md index a4a244ca..eda23e7d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -32,6 +32,8 @@ Amazon S3、GoogleCloud Storage、金山云 KS3、美团云 MSS、京东云 OSS 后续即将支持 Samba、NFS +`1.0.3` 修复了 FileStorageClientFactory 未自动加载等问题,查看 [更新记录](更新记录?id=103) +
`1.0.2` 修复了华为云 OBS 未加载的问题,查看 [更新记录](更新记录?id=102)
`1.0.1` 修复了 MultipartFile 无法正确获取文件名等问题,查看 [更新记录](更新记录?id=101) diff --git a/docs/_navbar.md b/docs/_navbar.md index b80bc3db..9442fbc3 100644 --- a/docs/_navbar.md +++ b/docs/_navbar.md @@ -1,4 +1,6 @@ -* 文档版本 1.0.2 +* 文档版本 1.0.3 + + * [1.0.3](https://spring-file-storage.xuyanwu.cn/1.0.3/) * [1.0.2](https://spring-file-storage.xuyanwu.cn/1.0.2/) * [1.0.1](https://spring-file-storage.xuyanwu.cn/1.0.1/) * [1.0.0](https://spring-file-storage.xuyanwu.cn/1.0.0/) diff --git "a/docs/\345\277\253\351\200\237\345\205\245\351\227\250.md" "b/docs/\345\277\253\351\200\237\345\205\245\351\227\250.md" index 2f8b08f5..5411bc8c 100644 --- "a/docs/\345\277\253\351\200\237\345\205\245\351\227\250.md" +++ "b/docs/\345\277\253\351\200\237\345\205\245\351\227\250.md" @@ -8,7 +8,7 @@ cn.xuyanwu spring-file-storage - 1.0.2 + 1.0.3 ``` diff --git "a/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" "b/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" index 8af402f0..e3cf5afd 100644 --- "a/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" +++ "b/docs/\346\233\264\346\226\260\350\256\260\345\275\225.md" @@ -1,5 +1,12 @@ # 更新记录 +## 1.0.3 +2023-08-17 +- 修复了 FileStorageClientFactory 未自动加载的问题 +- 优化了 HuaweiObsFileStorage 的 ACL 转换方式,使其兼容低版本 SDK +- 修复了 GoogleCloudStorageFileStorage 的 ACL 转换时空指针问题 +- 修复了 又拍云 USS 的错误提示问题 + ## 1.0.2 2023-08-09 - 修复了华为云 OBS 未加载的问题 diff --git "a/docs/\350\204\261\347\246\273SpringBoot\345\215\225\347\213\254\344\275\277\347\224\250.md" "b/docs/\350\204\261\347\246\273SpringBoot\345\215\225\347\213\254\344\275\277\347\224\250.md" index 1bb1743c..96ee7c29 100644 --- "a/docs/\350\204\261\347\246\273SpringBoot\345\215\225\347\213\254\344\275\277\347\224\250.md" +++ "b/docs/\350\204\261\347\246\273SpringBoot\345\215\225\347\213\254\344\275\277\347\224\250.md" @@ -8,7 +8,7 @@ cn.xuyanwu file-storage-core - 1.0.2 + 1.0.3 ``` diff --git a/file-storage-core/pom.xml b/file-storage-core/pom.xml index 442eacf5..86823fc0 100644 --- a/file-storage-core/pom.xml +++ b/file-storage-core/pom.xml @@ -5,12 +5,12 @@ spring-file-storage-parent cn.xuyanwu - 1.0.2 + 1.0.3 4.0.0 file-storage-core - 1.0.2 + 1.0.3 8 diff --git a/pom.xml b/pom.xml index faf2b76d..736cac3f 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ cn.xuyanwu spring-file-storage-parent pom - 1.0.2 + 1.0.3 spring-file-storage-parent A File Storage Service @@ -63,7 +63,7 @@ cn.xuyanwu file-storage-core - 1.0.2 + 1.0.3 diff --git a/spring-file-storage-test/pom.xml b/spring-file-storage-test/pom.xml index d245ac3b..082e253f 100644 --- a/spring-file-storage-test/pom.xml +++ b/spring-file-storage-test/pom.xml @@ -12,7 +12,7 @@ cn.xuyanwu spring-file-storage-test - 1.0.2 + 1.0.3 spring-file-storage-test spring-file-storage 的测试和演示模块 @@ -145,7 +145,7 @@ cn.xuyanwu spring-file-storage - 1.0.2 + 1.0.3 diff --git a/spring-file-storage/pom.xml b/spring-file-storage/pom.xml index 45f3d0b5..86d37b93 100644 --- a/spring-file-storage/pom.xml +++ b/spring-file-storage/pom.xml @@ -5,7 +5,7 @@ spring-file-storage-parent cn.xuyanwu - 1.0.2 + 1.0.3 4.0.0 From ed511437fbfe8ee5020127749589cac0d4bcd3ca Mon Sep 17 00:00:00 2001 From: xuyanwu <1171736840@qq.com> Date: Thu, 17 Aug 2023 17:22:40 +0800 Subject: [PATCH 8/8] =?UTF-8?q?Update=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" "b/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" index 4c31b78b..e8d35e98 100644 --- "a/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" +++ "b/docs/\345\255\230\345\202\250\345\271\263\345\217\260.md" @@ -243,8 +243,8 @@ public class HuaweiObsFileStorage implements FileStorage { } else if (acl instanceof String || acl == null) { String sAcl = (String) acl; if (StrUtil.isEmpty(sAcl)) sAcl = defaultAcl; - IConvertor convertor = ReflectUtil.invoke(getClient(),"getIConvertor",bucketName); - return convertor.transCannedAcl(sAcl); + if (sAcl == null) return null; + return ObsConvertor.getInstance().transCannedAcl(sAcl); } else { throw new FileStorageRuntimeException("不支持的ACL:" + acl); }