Fixed error in path recognizing for config dir in distribution

This commit is contained in:
selva.andre
2014-03-05 23:37:54 +01:00
parent 1897154cfd
commit 01bbbd3bda
5 changed files with 10 additions and 24 deletions
@@ -187,8 +187,9 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
subscriptions.init(m_storageService);
String path = props.getProperty("password_file");
IAuthenticator authenticator = new FileAuthenticator(path);
String passwdPath = props.getProperty("password_file");
String configPath = System.getProperty("moquette.path", "");
IAuthenticator authenticator = new FileAuthenticator(configPath + passwdPath);
m_processor.init(subscriptions, m_storageService, authenticator);
}
@@ -40,9 +40,10 @@ public class Server {
public void startServer() throws IOException {
ConfigurationParser confParser = new ConfigurationParser();
try {
confParser.parse(new File("config/moquette.conf"));
String configPath = System.getProperty("moquette.path", "");
confParser.parse(new File(configPath + "config/moquette.conf"));
} catch (ParseException pex) {
LOG.warn("An error occured in parsing configuration, fallback on deafult configuration", pex);
LOG.warn("An error occured in parsing configuration, fallback on default configuration", pex);
}
Properties configProps = confParser.getProperties();