// 读取配置文件工具类
public Prop(File file, String encoding) {
this.properties = null;
if (file == null) {
throw new IllegalArgumentException("File can not be null.");
} else if (!file.isFile()) {
throw new IllegalArgumentException("File not found : " + file.getName());
} else {
FileInputStream inputStream = null;
try {
inputStream = new FileInputStream(file);
this.properties = new Properties();
this.properties.load(new InputStreamReader(inputStream, encoding));
} catch (IOException var12) {
throw new RuntimeException("Error loading properties file.", var12);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException var11) {
logger.error(var11.getMessage(), var11);
}
}
}
}
}
详见
https://gitee.com/xchao/j-im