linux下如果有前缀就不增加了

This commit is contained in:
thinkgem
2023-09-18 10:59:04 +08:00
parent 95fb0a5764
commit 440bb920b7

View File

@@ -784,7 +784,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
if (!StringUtils.endsWithAny(p, SEPARATOR) && StringUtils.endsWithAny(path, WIN_SEPARATOR, SEPARATOR)){
p = p + SEPARATOR;
}
if (path != null && path.startsWith(SEPARATOR)){
if (path != null && path.startsWith(SEPARATOR) && !p.startsWith(SEPARATOR)){
p = SEPARATOR + p; // linux下路径
}
return p;