Normalize UNC paths too

This commit is contained in:
Roman Shevchenko
2012-04-14 20:35:05 +02:00
parent ea32b30f2f
commit 0bdec8fbf5
@@ -103,11 +103,10 @@ public abstract class LocalFileSystemBase extends LocalFileSystem {
}
if (SystemInfo.isWindows) {
if (path.startsWith("//") || path.startsWith("\\\\")) {
return path;
if (path.charAt(0) == '/' && !path.startsWith("//")) {
path = path.substring(1); // hack over new File(path).toUrl().getFile()
}
if (path.charAt(0) == '/') path = path.substring(1); //hack over new File(path).toUrl().getFile()
if (path.contains("~")) {
try {
return new File(path.replace('/', File.separatorChar)).getCanonicalPath().replace(File.separatorChar, '/');
@@ -123,7 +122,6 @@ public abstract class LocalFileSystemBase extends LocalFileSystem {
}
}
return path.replace(File.separatorChar, '/');
}