mirror of
https://github.com/corda/corda.git
synced 2025-02-10 12:51:37 +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) {
|
public File(String path) {
|
||||||
if (path == null) throw new NullPointerException();
|
if (path == null) throw new NullPointerException();
|
||||||
this.path = path;
|
this.path = normalize(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public File(String parent, String child) {
|
public File(String parent, String child) {
|
||||||
@ -35,6 +35,14 @@ public class File {
|
|||||||
this(parent.getPath() + FileSeparator + child);
|
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 static native boolean rename(String old, String new_);
|
||||||
|
|
||||||
public boolean renameTo(File newName) {
|
public boolean renameTo(File newName) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user