update the configuration file to point back automatically

This commit is contained in:
idk
2022-09-13 02:03:09 -04:00
parent 0183222ac9
commit 11a8f2cb08
2 changed files with 45 additions and 20 deletions

View File

@ -232,6 +232,28 @@ public class CopyConfigDir {
return null;
}
/**
* get the path to the binary of the app-image root by getting the path to
* java.home and the OS, and traversing up to the app-image root based on that
* information, then getting the binary path on a per-platform basis. The path
* returned will be relative to the root.
*
* @return the app-image root
*/
protected static String appImageExe() {
File aih = appImageHome();
if (aih != null) {
switch (osName()) {
case "windows":
return "I2P.exe";
case "mac":
case "linux":
return "./bin/I2P";
}
}
return null;
}
/**
* get the path to the default config of the app-image by getting the path to
* java.home and the OS, and traversing up to the app-image root based on that
@ -272,6 +294,17 @@ public class CopyConfigDir {
return copyConfigDirectory(appImageConfigDir, appImageHomeDir);
}
protected static String routerConfig() {
File appImageHomeDir = appImageHome();
File routerConf = new File(appImageHomeDir, "router.config");
if (routerConf != null) {
if (routerConf.exists()) {
return routerConf.getAbsolutePath();
}
}
return null;
}
/**
* set up the path to the log file
*