mirror of
https://github.com/corda/corda.git
synced 2025-02-09 20:31:18 +00:00
convert forward slashes to back slashes in Windows paths
This commit is contained in:
parent
b1a1391093
commit
2c4e229e6e
@ -24,7 +24,7 @@ public class File {
|
||||
|
||||
public File(String path) {
|
||||
if (path == null) throw new NullPointerException();
|
||||
this.path = path;
|
||||
this.path = normalize(path);
|
||||
}
|
||||
|
||||
public File(String parent, String child) {
|
||||
@ -35,6 +35,14 @@ public class File {
|
||||
this(parent.getPath() + FileSeparator + child);
|
||||
}
|
||||
|
||||
private static String normalize(String path) {
|
||||
if ("\\".equals(FileSeparator)) {
|
||||
return path.replace('/', '\\');
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
public static native boolean rename(String old, String new_);
|
||||
|
||||
public boolean renameTo(File newName) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user