FileWatchdog.java 文件源码

java
阅读 73 收藏 0 点赞 0 评论 0

项目:cacheonix-core 作者:
protected
 void checkAndConfigure() {
   boolean fileExists;
   try {
     fileExists = file.exists();
   } catch(SecurityException  e) {
     LogLog.warn("Was not allowed to read check file existance, file:["+
      filename+"].");
     interrupted = true; // there is no point in continuing
     return;
   }

   if(fileExists) {
     long l = file.lastModified(); // this can also throw a SecurityException
     if(l > lastModif) {           // however, if we reached this point this
lastModif = l;              // is very unlikely.
doOnChange();
warnedAlready = false;
     }
   } else {
     if(!warnedAlready) {
LogLog.debug("["+filename+"] does not exist.");
warnedAlready = true;
     }
   }
 }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号