getContainer().run(false, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
availablePackages.clear();
selectedPackages.clear();
for (IPath path : paths) {
Jar jar = null;
try {
if (path.isAbsolute())
jar = new Jar(path.toFile());
else
jar = new Jar(ResourcesPlugin.getWorkspace().getRoot().getLocation().append(path).toFile());
Map<String,Map<String,Resource>> dirs = jar.getDirectories();
for (Entry<String,Map<String,Resource>> entry : dirs.entrySet()) {
if (entry.getValue() == null)
continue;
IPath packagePath = new Path(entry.getKey());
if (packagePath.segmentCount() < 1)
continue;
if ("META-INF".equalsIgnoreCase(packagePath.segment(0)))
continue;
availablePackages.add(packagePath);
}
} catch (Exception e) {} finally {
if (jar != null)
jar.close();
}
}
}
});
} catch (InvocationTargetException e) {