Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2008-08-08 16:07:39 +0000
committerSimon Kaegi2008-08-08 16:07:39 +0000
commit7a015712e2267d4a682f038ada3135ee46853d75 (patch)
treeec84637b32a711840e166e6bbc431c8e9bb1fa28
parent3fa75d8b21f42039883d9959e390c9341f83dc79 (diff)
downloadrt.equinox.p2-7a015712e2267d4a682f038ada3135ee46853d75.tar.gz
rt.equinox.p2-7a015712e2267d4a682f038ada3135ee46853d75.tar.xz
rt.equinox.p2-7a015712e2267d4a682f038ada3135ee46853d75.zip
Bug 237926 p2 should only treat jars and folders as plug-ins
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
index 1088d8458..0f1fdabe4 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java
@@ -233,11 +233,13 @@ public class SiteListener extends RepositoryListener {
File featureDir = new File(siteLocation, FEATURES);
File[] children = featureDir.listFiles();
for (int i = 0; i < children.length; i++) {
- File child = children[i];
- FeatureParser parser = new FeatureParser();
- Feature entry = parser.parse(child);
- if (entry != null)
- result.put(child, entry);
+ File featureLocation = children[i];
+ if (featureLocation.isDirectory() && featureLocation.getParentFile() != null && featureLocation.getParentFile().getName().equals("features") && new File(featureLocation, "feature.xml").exists()) {//$NON-NLS-1$ //$NON-NLS-2$
+ FeatureParser parser = new FeatureParser();
+ Feature entry = parser.parse(featureLocation);
+ if (entry != null)
+ result.put(featureLocation, entry);
+ }
}
return result;
}
@@ -260,10 +262,14 @@ public class SiteListener extends RepositoryListener {
Map result = new HashMap();
for (int i = 0; plugins != null && i < plugins.length; i++) {
File bundleLocation = plugins[i];
- BundleDescription description = factory.getBundleDescription(bundleLocation);
- String id = description.getSymbolicName();
- String version = description.getVersion().toString();
- result.put(id + '/' + version, bundleLocation);
+ if (bundleLocation.isDirectory() || bundleLocation.getName().endsWith(".jar")) {
+ BundleDescription description = factory.getBundleDescription(bundleLocation);
+ if (description != null) {
+ String id = description.getSymbolicName();
+ String version = description.getVersion().toString();
+ result.put(id + '/' + version, bundleLocation);
+ }
+ }
}
return result;
} finally {

Back to the top