Author: snjeza
Date: 2011-07-14 12:34:14 -0400 (Thu, 14 Jul 2011)
New Revision: 32921
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
Log:
JBIDE-9344 the bpel example has a empty folder that should not be there
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2011-07-14
16:26:25 UTC (rev 32920)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2011-07-14
16:34:14 UTC (rev 32921)
@@ -647,13 +647,27 @@
ZipLeveledStructureProvider structureProvider = new ZipLeveledStructureProvider(
sourceFile);
+ Enumeration<? extends ZipEntry> entries = sourceFile.entries();
+ ZipEntry entry = null;
+ List<ZipEntry> filesToImport = new ArrayList<ZipEntry>();
+ String prefix = projectName + "/"; //$NON-NLS-1$
+ while (entries.hasMoreElements()) {
+ entry = entries.nextElement();
+ if (entry.isDirectory()) {
+ continue;
+ }
+ if (entry.getName().startsWith(prefix)) {
+ filesToImport.add(entry);
+ }
+ }
+
structureProvider.setStrip(1);
- ImportOperation operation = new ImportOperation(project
- .getFullPath(), structureProvider.getRoot(), structureProvider,
- OVERWRITE_ALL_QUERY);
+ ImportOperation operation = new ImportOperation(project.getFullPath(),
structureProvider.getRoot(),
+ structureProvider, OVERWRITE_ALL_QUERY, filesToImport);
operation.setContext(getActiveShell());
operation.run(monitor);
reconfigure(project, monitor);
+
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
Show replies by date