Use normalizePathSeparators
This commit is contained in:
parent
6e69c8d512
commit
1391a2ffcb
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue