예제 #1
0
 /**
  * 加载指定文件/文件夹的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);
   }
 }
예제 #2
0
 public Collection<String> getValues() {
   return mp.values();
 }
예제 #3
0
 public List<String> getKeys() {
   return mp.keys();
 }
예제 #4
0
 public String get(String key, String defaultValue) {
   return Strings.sNull(mp.get(key), defaultValue);
 }
예제 #5
0
 public String get(String key) {
   return mp.get(key);
 }
예제 #6
0
 public void put(String key, String value) {
   mp.put(key, value);
 }