programatically import project [message #554069] |
Fri, 20 August 2010 02:59 |
Renato Novais Messages: 1 Registered: August 2010 |
Junior Member |
|
|
Hi, i'm developing a plugin that import some projects from the hard disk.
I have to import many diferent versions of the same project, so i decided first of all rename the folders
for ex:
project MobileMedia (version 1, 2 and 3) are renamed to
MobileMediaV1
MobileMediaV2
MobileMediaV3
at this point all this project have the same project description name (MobileMedia).
The second step is rename the project description.
In the second step, If these project are outside the workspace, every think works fine, otherwise I receive the following error
E:\projects\java\workspace\runtime-EclipseApplication\tags.V 4.0.Mobile Media overlaps the location of another project: 'tags.V4.0.Mobile Media'
This error only happens if the projects are inside the workspace.
the code i'm using is:
try {
String file = getFolderExport() + "/"
+ getFolderName() + "/.project";
/*the problem happens when getFolderExport() returns the workspace folder*/
IProjectDescription description = ResourcesPlugin.getWorkspace()
.loadProjectDescription(new Path(file));
IProject project = ResourcesPlugin.getWorkspace().getRoot()
.getProject(description.getName());
if (project.exists())
project.delete(true, null);
project.create(description, IProject.FORCE, null);
project.open(null);
description.setName(node.getFolderName());
project.move(description, IProject.FORCE, null);
ijproject = JavaCore.create(project);
} catch (CoreException e) {
e.printStackTrace();
}
I appreciate any help!
best regards!!
[Updated on: Fri, 20 August 2010 03:00] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03280 seconds