I am trying to importing the project to eclipse through programmatically. I dont want to use UI mode.
Below is the code I used for importing the project:
IProjectDescription description = ResourcesPlugin.getWorkspace().loadProjectDescription( new Path("PROJECT_PATH/.project"));
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(description.getName());
project.create(description, null);
project.open(null);
I'm getting only the project folder along with .location file
, .markers.snap
file and .syncinfo.snap
files, but I am not getting the source folder and etc.
Use
org.eclipse.ui.wizards.datatransfer.ImportOperation
Try something like this:
You're probably missing a line with
Your code seems to be fine. What do you exactly mean by you couldn't get the source folder? Have you tried to refresh the project?
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());