mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-02 16:49:10 +00:00
Merge pull request #314 from Parabot/feature/class-path-stripper
[FEATURE] Added valid class path
This commit is contained in:
@@ -23,11 +23,23 @@ public class SystemRedirect {
|
||||
System.exit(i);
|
||||
}
|
||||
|
||||
private static String getClassPath(){
|
||||
String classPath = System.getProperty("java.class.path");
|
||||
StringBuilder finalClassPath = new StringBuilder();
|
||||
for (String path : classPath.split(":")) {
|
||||
if (!path.toLowerCase().contains("parabot")) {
|
||||
finalClassPath.append(path).append(":");
|
||||
}
|
||||
}
|
||||
|
||||
return finalClassPath.toString();
|
||||
}
|
||||
|
||||
public static String getProperty(String s) {
|
||||
String value;
|
||||
switch (s) {
|
||||
case "java.class.path":
|
||||
value = ".";
|
||||
value = getClassPath();
|
||||
break;
|
||||
default:
|
||||
value = System.getProperty(s);
|
||||
@@ -42,14 +54,14 @@ public class SystemRedirect {
|
||||
String value = null;
|
||||
switch (s2) {
|
||||
case "java.class.path":
|
||||
value = ".";
|
||||
value = getClassPath();
|
||||
break;
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
switch (s) {
|
||||
case "java.class.path":
|
||||
value = ".";
|
||||
value = getClassPath();
|
||||
break;
|
||||
default:
|
||||
value = System.getProperty(s);
|
||||
|
||||
Reference in New Issue
Block a user