[TASK] Added class path redirect

This commit is contained in:
JKetelaar
2017-01-25 12:22:08 +01:00
parent b0aa62ca32
commit 6cc3e81583
@@ -27,7 +27,10 @@ public class SystemRedirect {
String value; String value;
switch (s) { switch (s) {
case "user.home": case "user.home":
value = Directories.getHomeDir().getAbsolutePath(); value = Directories.getCachePath().getAbsolutePath();
break;
case "java.class.path":
value = ".";
break; break;
default: default:
value = System.getProperty(s); value = System.getProperty(s);
@@ -40,14 +43,20 @@ public class SystemRedirect {
String value = null; String value = null;
switch (s2) { switch (s2) {
case "user.home": case "user.home":
value = Directories.getHomeDir().getAbsolutePath(); value = Directories.getCachePath().getAbsolutePath();
break;
case "java.class.path":
value = ".";
break; break;
} }
if (value == null) { if (value == null) {
switch (s) { switch (s) {
case "user.home": case "user.home":
value = Directories.getHomeDir().getAbsolutePath(); value = Directories.getCachePath().getAbsolutePath();
break;
case "java.class.path":
value = ".";
break; break;
default: default:
value = System.getProperty(s); value = System.getProperty(s);
@@ -62,11 +71,12 @@ public class SystemRedirect {
} }
public static String setProperty(String s1, String s2) { public static String setProperty(String s1, String s2) {
System.out.printf("SetSystemProp %s = %s", s1, s2); System.out.printf("SetSystemProp %s = %s\n", s1, s2);
return System.setProperty(s1, s2); return System.setProperty(s1, s2);
} }
public static String getenv(String string) { public static String getenv(String string) {
System.out.printf("getEnv %s = %s\n", string, System.getenv(string));
return System.getenv(string); return System.getenv(string);
} }
@@ -74,7 +84,6 @@ public class SystemRedirect {
} }
public static void setErr(PrintStream printStream) { public static void setErr(PrintStream printStream) {
} }