if (lastModified != configLastModified) {
log.info((isLoaded ? "reloading" : "loading") + " config from " + configFile.getAbsolutePath());
configLastModified = lastModified;
try {
MaxmlMap map = Maxml.parse(configFile);
if (!isLoaded) {
// only read these settings on a cold start
httpPort = map.getInt("httpPort", httpPort);
httpsPort = map.getInt("httpsPort", httpPort);
proxyPort = map.getInt("proxyPort", proxyPort);
shutdownPort = map.getInt("shutdownPort", shutdownPort);
bindAddresses = map.getStrings("bindAddresses", bindAddresses);
keystorePassword = map.getString("keystorePassword", keystorePassword);
userAgent = map.getString("userAgent", userAgent);
moxieRoot = new File(map.getString("rootFolder", "moxie"));
setMoxieRoot(moxieRoot);
localRepositories = map.getStrings("localRepositories", localRepositories);
remoteRepositories = parseRemoteRepositories(map);
for (RemoteRepository repository : remoteRepositories) {
remoteRepositoryLookup.put(repository.id, repository);
remoteRepositoryLookup.put(StringUtils.urlToFolder(repository.url), repository);
}
// do not reload these immutable settings
isLoaded = true;
}
proxies = parseProxies(map);
dateFormat = map.getString("dateFormat", dateFormat);
redirects = parseRedirects(map);
allowDeny = parseAllowDeny(map);
atomCount = map.getInt("atomCount", atomCount);
searchCount = map.getInt("searchCount", searchCount);
} catch (Exception e) {
log.log(Level.SEVERE, "failed to parse " + configFile, e);
}
}
}