@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); }
@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; }