mirror of
https://github.com/corda/corda.git
synced 2025-03-03 12:57:29 +00:00
Adds separatorChar and pathSeparatorChar fields to File ...
... and fixes a bug which caused path.separator to always return null.
This commit is contained in:
parent
da69b735f4
commit
5827c450c9
@ -653,6 +653,8 @@ Java_java_lang_System_getProperty(JNIEnv* e, jclass, jstring name,
|
||||
r = e->NewStringUTF("\r\n");
|
||||
} else if (strcmp(chars, "file.separator") == 0) {
|
||||
r = e->NewStringUTF("\\");
|
||||
} else if (strcmp(chars, "path.separator") == 0) {
|
||||
r = e->NewStringUTF(";");
|
||||
} else if (strcmp(chars, "os.name") == 0) {
|
||||
# if !defined(WINAPI_FAMILY) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
r = e->NewStringUTF("Windows");
|
||||
@ -726,6 +728,8 @@ Java_java_lang_System_getProperty(JNIEnv* e, jclass, jstring name,
|
||||
r = e->NewStringUTF("\n");
|
||||
} else if (strcmp(chars, "file.separator") == 0) {
|
||||
r = e->NewStringUTF("/");
|
||||
} else if (strcmp(chars, "path.separator") == 0) {
|
||||
r = e->NewStringUTF(":");
|
||||
} else if (strcmp(chars, "os.name") == 0) {
|
||||
#ifdef __APPLE__
|
||||
r = e->NewStringUTF("Mac OS X");
|
||||
|
@ -16,11 +16,15 @@ public class File implements Serializable {
|
||||
|
||||
public static final String separator = FileSeparator;
|
||||
|
||||
public static final char separatorChar = FileSeparator.charAt(0);
|
||||
|
||||
private static final String PathSeparator
|
||||
= System.getProperty("path.separator");
|
||||
|
||||
public static final String pathSeparator = PathSeparator;
|
||||
|
||||
public static final char pathSeparatorChar = PathSeparator.charAt(0);
|
||||
|
||||
// static {
|
||||
// System.loadLibrary("natives");
|
||||
// }
|
||||
|
Loading…
x
Reference in New Issue
Block a user