summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHolger Oehm2011-09-02 09:32:56 (EDT)
committer jsievers2011-09-23 05:21:05 (EDT)
commit5cb6aac886b9a024a5de23ea95faf74f602d9b11 (patch)
tree6667448df1c382f9a11f650f7196454bb20579cf
parent8546b12bd83846e4da27bf044529b8690c9c114c (diff)
downloadorg.eclipse.tycho-5cb6aac886b9a024a5de23ea95faf74f602d9b11.zip
org.eclipse.tycho-5cb6aac886b9a024a5de23ea95faf74f602d9b11.tar.gz
org.eclipse.tycho-5cb6aac886b9a024a5de23ea95faf74f602d9b11.tar.bz2
352505 Feature#readJar fails with ZipException for .DS_Store files
Only use directories and jar files with a name that does not start with a dot as candidates for features. Bug: 352505
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java
index a5c7d26..51f11b7 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java
@@ -12,6 +12,7 @@ package org.eclipse.tycho.core.osgitools.targetplatform;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
@@ -46,6 +47,16 @@ import copy.org.eclipse.core.runtime.internal.adaptor.PluginConverterImpl;
@Component(role = EclipseInstallationLayout.class, instantiationStrategy = "per-lookup")
public class EclipseInstallationLayout extends AbstractLogEnabled {
+ private static final class FEATURE_FILTER implements FileFilter {
+ public boolean accept(File pathname) {
+ if (pathname.getName().startsWith(".")) {
+ // filter out all dot files (like .svn or .DS_Store).
+ return false;
+ }
+ return pathname.isDirectory() || pathname.getName().endsWith(".jar");
+ }
+ }
+
public static final String PLUGINS = "plugins";
public static final String FEATURES = "features";
@@ -63,10 +74,9 @@ public class EclipseInstallationLayout extends AbstractLogEnabled {
public Set<File> getFeatures(File site) {
Set<File> result = new LinkedHashSet<File>();
-
- File[] plugins = new File(site, FEATURES).listFiles();
- if (plugins != null) {
- result.addAll(Arrays.asList(plugins));
+ File[] features = new File(site, FEATURES).listFiles(new FEATURE_FILTER());
+ if (features != null) {
+ result.addAll(Arrays.asList(features));
}
return result;