예제 #1
0
 public synchronized boolean reload(boolean force) {
   long now = System.currentTimeMillis();
   if (force == false && now < last_check + 3000) return false;
   last_check = now;
   File file = getPropertyFile();
   if (file.lastModified() == last_load_time) {
     return false;
   }
   last_load_time = file.lastModified();
   Properties temp = new Properties();
   if (file.canRead()) {
     FileInputStream in = null;
     try {
       in = new FileInputStream(file);
       temp.load(in);
     } catch (Exception e) {
       e.printStackTrace();
     } finally {
       FileUtil.close(in);
     }
   }
   property = ConfigValueUtil.replaceSysProp(temp);
   apply();
   ConfObserver.run();
   return true;
 }