I'm trying to figure out how to import an Eclipse project from an archive file (a .zip
) programmatically - I want to do the same thing the import wizard does, but automatically (re-importing the same project regularly using the wizard is starting to feel really long-winded). I've found some related questions (e.g. Programmatically importing an existing project into Eclipse), but I can't figure out how to get the same sort of thing working for the .zip
import.
My current thinking is as follows: if I can get a project description from the .zip
somehow, then I can programmatically create the project (as per the referenced question). From there, I'm hoping I can:
- Create a
ZipLeveledStructureProvider
(http://javasourcecode.org/html/open-source/eclipse/eclipse-3.5.2/org/eclipse/ui/internal/wizards/datatransfer/ZipLeveledStructureProvider.java.html) for the.zip
file. - Run an
ImportOperation
(http://javasourcecode.org/html/open-source/eclipse/eclipse-3.5.2/org/eclipse/ui/wizards/datatransfer/ImportOperation.java.html) to import the contents of the.zip
into the created project.
Does this make any sense? (If not, what should I be doing please?) If so, how should I be going about getting a project description from the .zip
?