public class ConfigUtil {
private ConfigUtil() {
}
private static Properties properties = null;
public static Properties getInstense(){
if (properties == null){
return getProperties();
}else {
return properties;
}
}
private static Properties getProperties() {
Properties properties = new Properties();
InputStream is = ServantFactory.class.getClassLoader().getResourceAsStream("conf/tars-conf.properties");
BufferedReader bs = new BufferedReader(new InputStreamReader(is));
try {
properties.load(bs);
} catch (IOException e) {
e.printStackTrace();
}
return properties;
}
}
解决Properties乱码
最新推荐文章于 2024-05-22 15:44:57 发布