Fixed error in path recognizing for config dir in distribution
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user