@Override public boolean renameFile(File file, String newName) { // check whether the new filename is conflicting with existing ones // or not boolean result = false; if (contains(newName)) { return result; } // replace the file name in the file (physical) list File obj = getFile(file.getName()); if (obj == null) { return result; } else { obj.setName(newName); } // replace the file name in the name list Iterator<String> it = nameList.iterator(); while (it.hasNext()) { String name = it.next(); if (name.equals(file.getName())) { file.setTransactionTime(0); nameList.remove(name); nameList.add(newName); result = true; break; } } return result; }