|
@@ -5,6 +5,7 @@ import com.fdkankan.fusion.config.CacheUtil;
|
|
|
import com.fdkankan.fusion.response.FileInfoVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -52,7 +53,11 @@ public class LocalToOssUtil {
|
|
|
try {
|
|
|
String[] split = objectName.replaceAll("/", Matcher.quoteReplacement(File.separator)).split(Matcher.quoteReplacement(File.separator));
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
- for (int i = 1; i <split.length;i++){
|
|
|
+ int index = 1;
|
|
|
+ if(StringUtils.isBlank(split[0])){
|
|
|
+ index = 2;
|
|
|
+ }
|
|
|
+ for (int i = index; i <split.length;i++){
|
|
|
result.append(split[i]);
|
|
|
if(i <split.length -1){
|
|
|
result.append(File.separator);
|