Files
plugin-s3/src
longjuan 21b752dd25 feat: check the file already exists before uploading (#11)
Fixes https://github.com/halo-dev/halo/issues/2945
```release-note
Add file check with the same name when uploading
```

我这里使用了ConcurrentHashMap避免**同时**上传两个同名文件导致文件覆盖问题,在本地存储策略中是由操作系统保证的
不知道这样是不是一个好方法

S3AsyncClient中没有`doesObjectExist`类似的方法,官方的文档也让用`headObject`捕获异常的办法来判断文件是否存在,详见https://github.com/aws/aws-sdk-java-v2/blob/master/docs/LaunchChangelog.md 中搜索`doesObjectExist`
2023-01-28 06:40:10 +00:00
..