GP-693 revised ServerAdmin to restore ability to specify repositories

root used during testing
This commit is contained in:
ghidra1 2021-03-22 19:20:35 -04:00
parent fe0f67cd5e
commit 2df5abb461

View File

@ -417,19 +417,32 @@ public class ServerAdmin implements GhidraLaunchable {
}
}
/**
* Parse contents of specified configFilePath as server.conf to determine
* repositories root directory. If configFilePath corresponds to a directory,
* that directory will be treated as the repositories root directory.
* @param configFilePath path to server.conf or repositories root directory
* @return repositories root directory
*/
private File getServerDirFromConfig(String configFilePath) {
System.out.println("Using config file: " + configFilePath);
if (configFilePath == null) {
return null;
}
File configFile = new File(configFilePath);
if (!configFile.exists()) {
System.out.println("Config file not found: " + configFile.getAbsolutePath());
return null;
}
if (configFile.isDirectory()) {
// If specified path is a directory treat as the server root
return configFile;
}
System.out.println("Using config file: " + configFilePath);
Properties config = new Properties();
InputStream in = null;
try {