Refactored config file resource loading to make it easier to load config files from class path when embedding.

This commit is contained in:
Neeme Praks
2016-12-31 11:46:32 +01:00
committed by andsel
parent c36ebc648b
commit ac93f04dde
12 changed files with 373 additions and 167 deletions
@@ -15,11 +15,15 @@
*/
package io.moquette.server.config;
import io.moquette.BrokerConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.text.ParseException;
import java.util.Properties;
@@ -100,6 +104,14 @@ class ConfigurationParser {
} catch (IOException ex) {
throw new ParseException("Failed to read", 1);
}
finally {
try {
reader.close();
}
catch (IOException e) {
// ignore
}
}
}
Properties getProperties() {