Author: snjeza
Date: 2011-08-05 18:25:48 -0400 (Fri, 05 Aug 2011)
New Revision: 33641
Modified:
branches/jbosstools-3.2.x/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:
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
---
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2011-08-05
22:09:45 UTC (rev 33640)
+++
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2011-08-05
22:25:48 UTC (rev 33641)
@@ -643,11 +643,23 @@
ZipFile sourceFile = new ZipFile(file);
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);
Show replies by date