* support for HARDLINK_OR_COPY action

This commit is contained in:
Reinhard Pointner 2014-08-10 07:11:09 +00:00
parent ad78796bec
commit 6d4cbbcdea
1 changed files with 13 additions and 1 deletions

View File

@ -72,10 +72,22 @@ public enum StandardRenameAction implements RenameAction {
} }
}, },
HARDLINK_OR_COPY {
@Override
public File rename(File from, File to) throws Exception {
try {
return HARDLINK.rename(from, to);
} catch (Exception e) {
return COPY.rename(from, to);
}
}
},
RENAME { RENAME {
@Override @Override
public File rename(File from, File to) throws IOException { public File rename(File from, File to) throws Exception {
// rename only the filename // rename only the filename
File dest = new File(from.getParentFile(), to.getName()); File dest = new File(from.getParentFile(), to.getName());