/** * 加载指定文件/文件夹的Properties文件,合并成一个Properties对象 * * <p><b style=color:red>如果有重复的key,请务必注意加载的顺序!!<b/> * * @param paths 需要加载的Properties文件路径 */ public void setPaths(String... paths) { mp = new MultiLineProperties(); List<NutResource> list = Scans.me().loadResource("^.+[.]properties$", paths); try { if (utf8) for (NutResource nr : list) mp.load(nr.getReader()); else { Properties p = new Properties(); for (NutResource nr : list) { p.load(nr.getInputStream()); } mp.putAll(p); } } catch (IOException e) { throw Lang.wrapThrow(e); } }
public Collection<String> getValues() { return mp.values(); }
public List<String> getKeys() { return mp.keys(); }
public String get(String key, String defaultValue) { return Strings.sNull(mp.get(key), defaultValue); }
public String get(String key) { return mp.get(key); }
public void put(String key, String value) { mp.put(key, value); }