Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-core-dev] Trying to move a project

This would be a good question for the Eclipse forums:

http://www.eclipse.org/forums/index.php?t=thread&frm_id=11&S=850893fd4d9f755114a0d74d67aef7ca

john

> Mikael Petterson <mikael.petterson@xxxxxxxxxxxx>
> Sent by: platform-core-dev-bounces@xxxxxxxxxxx
> 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.java:925)
> at org.eclipse.core.internal.resources.Project.move(Project.java: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?
> I am out of ideas...

Back to the top