|
@@ -26,6 +26,7 @@ import java.net.URL;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Component
|
|
|
@ConditionalOnProperty(name = "fyun.type", havingValue = "https")
|
|
@@ -323,7 +324,14 @@ public class HttpFileService extends AbstractFYunFileService {
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3002);
|
|
|
}
|
|
|
log.info("文件列举成功,path:{}", sourcePath);
|
|
|
- return JSONObject.parseArray(responseEntity.getBody().getData().toString(),String.class);
|
|
|
+ List<String> list = JSONObject.parseArray(responseEntity.getBody().getData().toString(),String.class);
|
|
|
+ return list.stream().map(str->{
|
|
|
+ if(str.startsWith("/")){
|
|
|
+ return str.replaceFirst("/", "");
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
log.error("列举文件目录失败,key=" + sourcePath, e);
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3002);
|