コード例 #1
0
 @Override
 public Date getFileModifiedDate(String name) {
   File file = getFile(name);
   if (!file.exists()) {
     return null;
   }
   long lastModified;
   if (fileModificationDateStorage.contains(KEYPREFIX + name)) {
     lastModified = fileModificationDateStorage.getLong(KEYPREFIX + name);
   } else {
     lastModified = file.lastModified();
   }
   return new Date(lastModified);
 }
コード例 #2
0
 @Override
 public boolean setFileModifiedTime(String name, long time) {
   File file = getFile(name);
   if (!file.exists()) {
     return false;
   }
   boolean success = file.setLastModified(time);
   if (!success) {
     fileModificationDateStorage.put(KEYPREFIX + name, time);
   }
   return true;
 }