Use normalizePathSeparators

This commit is contained in:
Reinhard Pointner 2017-02-09 16:21:32 +08:00
parent 6e69c8d512
commit 1391a2ffcb
2 changed files with 8 additions and 4 deletions

View File

@ -193,7 +193,11 @@ public class ExpressionFormat extends Format {
}
protected CharSequence normalizeExpressionValue(Object value) {
return value == null ? null : value.toString();
if (value == null) {
return null;
}
return normalizePathSeparators(value.toString());
}
protected String normalizeResult(CharSequence value) {

View File

@ -630,10 +630,10 @@ public final class FileUtilities {
public static String normalizePathSeparators(String path) {
// special handling for UNC paths
if (path.startsWith(UNC_PREFIX) && path.length() > 2) {
return UNC_PREFIX + path.substring(2).replace('\\', '/');
if (path.startsWith(UNC_PREFIX)) {
return UNC_PREFIX + replacePathSeparators(path.substring(UNC_PREFIX.length()), "/");
}
return path.replace('\\', '/');
return replacePathSeparators(path, "/");
}
public static String replacePathSeparators(CharSequence path) {