This commit is contained in:
Looly 2019-09-28 03:30:33 +08:00
parent 31e8ef6306
commit 367d0d40b8

View File

@ -1548,7 +1548,7 @@ public class FileUtil {
// 去除file:前缀
pathToUse = StrUtil.removePrefixIgnoreCase(pathToUse, URLUtil.FILE_URL_PREFIX);
// 统一使用斜杠
pathToUse = pathToUse.replaceAll("[/\\\\]{2,}", StrUtil.SLASH).trim();
pathToUse = pathToUse.replaceAll("[/\\\\]+", StrUtil.SLASH).trim();
//兼容Windows下的共享目录路径原始路径如果以\\开头则保留这种路径
if(path.startsWith("\\\\")){
pathToUse = "\\" + pathToUse;