Moves this resource to be at the given location.
This is a convenience method, fully equivalent to:
move(destination, (keepHistory ? KEEP_HISTORY : IResource.NONE) | (force ? FORCE : IResource.NONE), monitor);
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that this file has been removed from its parent and a new file has been added to the parent of the destination.
This method is long-running; progress and cancellation are provided by the given progress monitor.
@param destination the destination path
@param force a flag controlling whether resources that are notin sync with the local file system will be tolerated
@param keepHistory a flag controlling whether files under this foldershould be stored in the workspace's local history
@param monitor a progress monitor, or
null
if progressreporting is not desired
@exception CoreException if this resource could not be moved. Reasons include:
- This resource does not exist.
- This resource is not local.
- The resource corresponding to the parent destination path does not exist.
- The resource corresponding to the parent destination path is a closed project.
- A resource at destination path does exist.
- A resource of a different type exists at the destination path.
- This resource is out of sync with the local file system and
force
is false
. - The workspace and the local file system are out of sync at the destination resource or one of its descendents.
- Resource changes are disallowed during certain types of resource change event notification. See
IResourceChangeEvent
for more details.
@exception OperationCanceledException if the operation is canceled. Cancelation can occur even if no progress monitor is provided.
@see IResource#move(IPath,int,IProgressMonitor)
@see IResourceRuleFactory#moveRule(IResource,IResource)