Source:
public void move(IFileStore destFile, int options, IProgressMonitor monitor) throws CoreException { if (!(destFile instanceof LocalFile)) { super.move(destFile, options, monitor); return; } File source = file; File destination = ((LocalFile) destFile).file; boolean overwrite = (options & EFS.OVERWRITE) != 0; monitor = Policy.monitorFor(monitor); try { SubMonitor subMonitor = SubMonitor.convert(monitor, NLS.bind(Messages.moving, source.getAbsolutePath()), 10); boolean sourceEqualsDest = false; try { sourceEqualsDest = source.getCanonicalFile().equals(destination.getCanonicalFile()); } catch (IOException e) { String message = NLS.bind(Messages.couldNotMove, source.getAbsolutePath()); Policy.error(EFS.ERROR_WRITE, message, e); } if (!sourceEqualsDest && !overwrite && destination.exists()) { String message = NLS.bind(Messages.fileExists, destination.getAbsolutePath()); Policy.error(EFS.ERROR_EXISTS, message); } if (source.renameTo(destination)) { if (!sourceEqualsDest && source.exists()) { if (destination.exists()) { new LocalFile(destination).delete(EFS.NONE, null); String message = NLS.bind(Messages.couldnotDelete, source.getAbsolutePath()); Policy.error(EFS.ERROR_DELETE, message); } } else { if (!destination.exists() && !destFile.fetchInfo().getAttribute(EFS.ATTRIBUTE_SYMLINK)) { String message = NLS.bind(Messages.failedMove, source.getAbsolutePath(), destination.getAbsolutePath()); Policy.error(EFS.ERROR_WRITE, message); } monitor.worked(10); return; } } if (sourceEqualsDest) { String message = NLS.bind(Messages.couldNotMove, source.getAbsolutePath()); Policy.error(EFS.ERROR_WRITE, message, null); } super.move(destFile, options, subMonitor.newChild(10)); } finally { monitor.done(); } }

Target:
public void move(IFileStore destFile, int options, IProgressMonitor monitor) throws CoreException { if (!(destFile instanceof LocalFile)) { super.move(destFile, options, monitor); return; } File source = file; File destination = ((LocalFile) destFile).file; boolean overwrite = (options & EFS.OVERWRITE) != 0; SubMonitor subMonitor = SubMonitor.convert(monitor, NLS.bind(Messages.moving, source.getAbsolutePath()), 1); try { boolean sourceEqualsDest = false; try { sourceEqualsDest = source.getCanonicalFile().equals(destination.getCanonicalFile()); } catch (IOException e) { String message = NLS.bind(Messages.couldNotMove, source.getAbsolutePath()); Policy.error(EFS.ERROR_WRITE, message, e); } if (!sourceEqualsDest && !overwrite && destination.exists()) { String message = NLS.bind(Messages.fileExists, destination.getAbsolutePath()); Policy.error(EFS.ERROR_EXISTS, message); } if (source.renameTo(destination)) { if (!sourceEqualsDest && source.exists()) { if (destination.exists()) { new LocalFile(destination).delete(EFS.NONE, null); String message = NLS.bind(Messages.couldnotDelete, source.getAbsolutePath()); Policy.error(EFS.ERROR_DELETE, message); } } else { if (!destination.exists() && !destFile.fetchInfo().getAttribute(EFS.ATTRIBUTE_SYMLINK)) { String message = NLS.bind(Messages.failedMove, source.getAbsolutePath(), destination.getAbsolutePath()); Policy.error(EFS.ERROR_WRITE, message); } return; } } if (sourceEqualsDest) { String message = NLS.bind(Messages.couldNotMove, source.getAbsolutePath()); Policy.error(EFS.ERROR_WRITE, message, null); } super.move(destFile, options, subMonitor.newChild(1)); } finally { subMonitor.done(); } }