* warn the noobs about MISSING EXTENSION issues with AbsolutePath mode before renaming

This commit is contained in:
Reinhard Pointner 2013-11-15 02:54:33 +00:00
parent 9ba3e36d23
commit 0a99a8f93d
1 changed files with 4 additions and 1 deletions

View File

@ -167,6 +167,9 @@ class RenameAction extends AbstractAction {
if (destination.exists() && !resolveDestination(mapping.getKey(), mapping.getValue(), false).equals(mapping.getKey())) if (destination.exists() && !resolveDestination(mapping.getKey(), mapping.getValue(), false).equals(mapping.getKey()))
throw new IllegalArgumentException("File already exists: " + mapping.getValue().getPath()); throw new IllegalArgumentException("File already exists: " + mapping.getValue().getPath());
if (getExtension(destination) == null)
throw new IllegalArgumentException("Missing extension: " + mapping.getValue().getPath());
// use original mapping values // use original mapping values
renameMap.put(mapping.getKey(), mapping.getValue()); renameMap.put(mapping.getKey(), mapping.getValue());
destinationSet.add(destination); destinationSet.add(destination);
@ -176,7 +179,7 @@ class RenameAction extends AbstractAction {
} }
if (issues.size() > 0) { if (issues.size() > 0) {
String text = "Some files cannot be renamed:"; String text = "We found some issues. Do you to continue?";
JList issuesComponent = new JList(issues.toArray()) { JList issuesComponent = new JList(issues.toArray()) {
@Override @Override