- if (targetFile.exists())
- System.out
- .println("Renaming aborted because target file: "
- + targetFile.getAbsolutePath()
- + " already exists.");
- else
- file.renameTo(targetFile);
+ } else {
+ System.out.println("About to rename file: "
+ + file.getAbsolutePath());
+ System.out.println("into: " + targetFile.getAbsolutePath());
+ }
+ }
+
+ public void processFileOrDirectory(final File file) {
+ if (!file.exists()) {
+ System.out.println("Error: file \"" + file.getAbsolutePath()
+ + "\" does not exist.");
+ return;
+ }