mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
refactor(file): S3无需判断运行环境,均使用/作为路径分隔符
Closes 5845
This commit is contained in:
1 parent
1a1e2be00f
commit
686c0c770f
1 file changed
+3
-3
+3
-3
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.common.file.oss.service;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.text.CharPool;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.amazonaws.ClientConfiguration;
|
||||
import com.amazonaws.auth.AWSCredentials;
|
||||
@@ -156,7 +156,7 @@ public class OssTemplate implements InitializingBean, FileTemplate {
|
||||
@Override
|
||||
public S3Object getObject(String bucketName, String dir, String objectName) {
|
||||
if (StrUtil.isNotBlank(dir)) {
|
||||
objectName = dir + '/' + objectName;
|
||||
objectName = dir + CharPool.SLASH + objectName;
|
||||
}
|
||||
return getObject(bucketName, objectName);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class OssTemplate implements InitializingBean, FileTemplate {
|
||||
throws Exception {
|
||||
if (StrUtil.isNotBlank(dir)) {
|
||||
// dir 路径为 a/b
|
||||
objectName = dir + '/' + objectName;
|
||||
objectName = dir + CharPool.SLASH + objectName;
|
||||
}
|
||||
|
||||
putObject(bucketName, objectName, stream, stream.available(), contextType);
|
||||
|
||||
Reference in new issue
Block a user