Hi,
I am working on a plugin.
In the plugin I am trying to move the project to a new destination.
I use the following code:
IWorkspace w=ResourcesPlugin.getWorkspace();
IProject projHandle = w.getRoot().getProject(project.getName());
IProjectDescription desc=w.newProjectDescription(projHandle.getName());
//I set a new location for path.
desc.setLocation(new Path(getLocation().getLocation()));
try {
projHandle.move(desc,true,monitor);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I get the following error in the console:
org.eclipse.core.internal.resources.ResourceException: Problems encountered while moving resources.
at org.eclipse.core.internal.resources.Project.move(Project.jav a:925)
at org.eclipse.core.internal.resources.Project.move(Project.jav a:884)
at net.sourceforge.eclipseccase.ui.wizard.share.SharingWizard$3 .run(SharingWizard.java:237)
at org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
Contains: Resource already exists on disk: 'C:\Users\mike\tmp'.
Any ideas what's wrong?
Or is it better to copy files to new location ( using java.io API)?
I am out of ideas...
//mike