Skip to content

Commit 11e4d1c

Browse files
authored
Merge pull request #107 from 1171736840/dev
Release 1.0.3
2 parents 44d7192 + ed51143 commit 11e4d1c

File tree

15 files changed

+40
-23
lines changed

15 files changed

+40
-23
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Amazon S3、GoogleCloud Storage、金山云 KS3、美团云 MSS、京东云 OSS
3232

3333
后续即将支持 Samba、NFS
3434

35+
`1.0.3` 修复了 FileStorageClientFactory 未自动加载等问题,查看 [更新记录](https://spring-file-storage.xuyanwu.cn/#/更新记录?id=103)
36+
<br />
3537
`1.0.2` 修复了华为云 OBS 未加载的问题,查看 [更新记录](https://spring-file-storage.xuyanwu.cn/#/更新记录?id=102)
3638
<br />
3739
`1.0.1` 修复了 MultipartFile 无法正确获取文件名等问题,查看 [更新记录](https://spring-file-storage.xuyanwu.cn/#/更新记录?id=101)

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Amazon S3、GoogleCloud Storage、金山云 KS3、美团云 MSS、京东云 OSS
3232

3333
后续即将支持 Samba、NFS
3434

35+
`1.0.3` 修复了 FileStorageClientFactory 未自动加载等问题,查看 [更新记录](更新记录?id=103)
36+
<br />
3537
`1.0.2` 修复了华为云 OBS 未加载的问题,查看 [更新记录](更新记录?id=102)
3638
<br />
3739
`1.0.1` 修复了 MultipartFile 无法正确获取文件名等问题,查看 [更新记录](更新记录?id=101)

docs/_navbar.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
* 文档版本 1.0.2
1+
* 文档版本 1.0.3
2+
3+
* [1.0.3](https://spring-file-storage.xuyanwu.cn/1.0.3/)
24
* [1.0.2](https://spring-file-storage.xuyanwu.cn/1.0.2/)
35
* [1.0.1](https://spring-file-storage.xuyanwu.cn/1.0.1/)
46
* [1.0.0](https://spring-file-storage.xuyanwu.cn/1.0.0/)

docs/存储平台.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ public class HuaweiObsFileStorage implements FileStorage {
243243
} else if (acl instanceof String || acl == null) {
244244
String sAcl = (String) acl;
245245
if (StrUtil.isEmpty(sAcl)) sAcl = defaultAcl;
246-
IConvertor convertor = ReflectUtil.invoke(getClient(),"getIConvertor",bucketName);
247-
return convertor.transCannedAcl(sAcl);
246+
if (sAcl == null) return null;
247+
return ObsConvertor.getInstance().transCannedAcl(sAcl);
248248
} else {
249249
throw new FileStorageRuntimeException("不支持的ACL:" + acl);
250250
}
@@ -391,7 +391,7 @@ public class HuaweiObsFileStorageClientFactory implements FileStorageClientFacto
391391
> [!TIP|label:小提示:]
392392
> 1. FTP 和 SFTP 就是通过 Client 工厂类和对象池配合来提升性能的,具体可以查看相关源码
393393
>
394-
> 2. 如果自定义的存储平台比较简单,也可以不用工厂类直接在存储平台中创建 Client 对象, `0.8.0` 之前的版本就是这种方式
394+
> 2. 如果自定义的存储平台比较简单,也可以不用工厂类直接在存储平台中创建 Client 对象, `1.0.0` 之前的版本就是这种方式
395395
>
396396
> 3. 如果自带的 Client 工厂类满足不了你的需求,例如想添加网络代理,只要自定义一个 Client 工厂类就可以了,不用重新自定义整个存储平台,在后续文档中会详细说明
397397
@@ -467,7 +467,7 @@ spring:
467467
@Bean
468468
public List<FileStorageClientFactory<?>> myHuaweiObsFileStorageClientFactory(SpringFileStorageProperties properties) {
469469
return properties.getHuaweiObs().stream()
470-
.filter(SpringHuaweiObsConfigConfig::getEnableStorage)
470+
.filter(SpringHuaweiObsConfig::getEnableStorage)
471471
.map(config -> new FileStorageClientFactory<ObsClient>() {
472472
private volatile ObsClient client;
473473

docs/快速入门.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<dependency>
99
<groupId>cn.xuyanwu</groupId>
1010
<artifactId>spring-file-storage</artifactId>
11-
<version>1.0.2</version>
11+
<version>1.0.3</version>
1212
</dependency>
1313
```
1414

docs/更新记录.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# 更新记录
22

3+
## 1.0.3
4+
2023-08-17
5+
- 修复了 FileStorageClientFactory 未自动加载的问题
6+
- 优化了 HuaweiObsFileStorage 的 ACL 转换方式,使其兼容低版本 SDK
7+
- 修复了 GoogleCloudStorageFileStorage 的 ACL 转换时空指针问题
8+
- 修复了 又拍云 USS 的错误提示问题
9+
310
## 1.0.2
4-
2023-08-08
11+
2023-08-09
512
- 修复了华为云 OBS 未加载的问题
613

714
## 1.0.1

docs/脱离SpringBoot单独使用.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<dependency>
99
<groupId>cn.xuyanwu</groupId>
1010
<artifactId>file-storage-core</artifactId>
11-
<version>1.0.2</version>
11+
<version>1.0.3</version>
1212
</dependency>
1313
```
1414

file-storage-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<parent>
66
<artifactId>spring-file-storage-parent</artifactId>
77
<groupId>cn.xuyanwu</groupId>
8-
<version>1.0.2</version>
8+
<version>1.0.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>file-storage-core</artifactId>
13-
<version>1.0.2</version>
13+
<version>1.0.3</version>
1414

1515
<properties>
1616
<maven.compiler.source>8</maven.compiler.source>

file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/GoogleCloudStorageFileStorage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ public AclWrapper getAcl(Object acl) {
130130
} else if (acl instanceof String || acl == null) {
131131
String sAcl = (String) acl;
132132
if (StrUtil.isEmpty(sAcl)) sAcl = defaultAcl;
133+
if (StrUtil.isEmpty(sAcl)) return null;
134+
sAcl = sAcl.replace("-","_");
133135
for (PredefinedAcl item : PredefinedAcl.values()) {
134-
if (item.toString().equalsIgnoreCase(sAcl.replace("-","_"))) {
136+
if (item.toString().equalsIgnoreCase(sAcl)) {
135137
return new AclWrapper(item);
136138
}
137139
}

file-storage-core/src/main/java/cn/xuyanwu/spring/file/storage/platform/HuaweiObsFileStorage.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package cn.xuyanwu.spring.file.storage.platform;
22

33
import cn.hutool.core.io.IoUtil;
4-
import cn.hutool.core.util.ReflectUtil;
54
import cn.hutool.core.util.StrUtil;
65
import cn.xuyanwu.spring.file.storage.FileInfo;
76
import cn.xuyanwu.spring.file.storage.FileStorageProperties.HuaweiObsConfig;
87
import cn.xuyanwu.spring.file.storage.ProgressListener;
98
import cn.xuyanwu.spring.file.storage.UploadPretreatment;
109
import cn.xuyanwu.spring.file.storage.exception.FileStorageRuntimeException;
1110
import com.obs.services.ObsClient;
12-
import com.obs.services.internal.IConvertor;
11+
import com.obs.services.internal.ObsConvertor;
1312
import com.obs.services.model.*;
1413
import lombok.Getter;
1514
import lombok.NoArgsConstructor;
@@ -158,8 +157,8 @@ public AccessControlList getAcl(Object acl) {
158157
} else if (acl instanceof String || acl == null) {
159158
String sAcl = (String) acl;
160159
if (StrUtil.isEmpty(sAcl)) sAcl = defaultAcl;
161-
IConvertor convertor = ReflectUtil.invoke(getClient(),"getIConvertor",bucketName);
162-
return convertor.transCannedAcl(sAcl);
160+
if (sAcl == null) return null;
161+
return ObsConvertor.getInstance().transCannedAcl(sAcl);
163162
} else {
164163
throw new FileStorageRuntimeException("不支持的ACL:" + acl);
165164
}

0 commit comments

Comments
 (0)