Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2006-08-10 11:51:08 -0400
committerThomas Watson2006-08-10 11:51:08 -0400
commit29caf249dcf878375cac40b87e769a6e45908cfe (patch)
tree0bb9f6b000c217f9d38af5a60b98257f93f3de39
parentd1e2093df97d2b792f9df5fda6fb9a98fc2699e4 (diff)
downloadrt.equinox.framework-29caf249dcf878375cac40b87e769a6e45908cfe.tar.gz
rt.equinox.framework-29caf249dcf878375cac40b87e769a6e45908cfe.tar.xz
rt.equinox.framework-29caf249dcf878375cac40b87e769a6e45908cfe.zip
Bug 143275 Exception in log during update: .keystore not found
-rw-r--r--bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java b/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java
index 10c013dc4..e07a66867 100644
--- a/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java
+++ b/bundles/org.eclipse.osgi/jarverifier/org/eclipse/osgi/internal/verifier/KeyStores.java
@@ -12,8 +12,7 @@
package org.eclipse.osgi.internal.verifier;
import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.*;
import java.security.*;
import java.security.cert.Certificate;
import java.util.*;
@@ -49,6 +48,7 @@ public class KeyStores {
private void processKeyStore(String urlSpec, String type, URL rootURL) {
if (type == null)
type = KeyStore.getDefaultType();
+ InputStream in = null;
try {
URL url;
try {
@@ -57,10 +57,24 @@ public class KeyStores {
url = new URL(rootURL, urlSpec);
}
KeyStore ks = KeyStore.getInstance(type);
- ks.load(url.openStream(), null);
- keyStores.add(ks);
+ try {
+ in = url.openStream();
+ } catch (IOException ioe) {
+ // ignore this; the file probably does not exist
+ }
+ if (in != null) {
+ ks.load(in, null);
+ keyStores.add(ks);
+ }
} catch (Exception e) {
SignedBundleHook.log(e.getMessage(), FrameworkLogEntry.WARNING, e);
+ } finally {
+ if (in != null)
+ try {
+ in.close();
+ } catch (IOException e){
+ // do nothing
+ }
}
}

Back to the top