diff options
author | John Arthorne | 2008-04-25 20:09:24 +0000 |
---|---|---|
committer | John Arthorne | 2008-04-25 20:09:24 +0000 |
commit | 0e91255ba25e817541b7db88f5a786c8d983773a (patch) | |
tree | 12c1a9f8f39902f3ae595b41ceffd3e08d024290 /bundles | |
parent | 274f9d517ebd859c507a44416f25557818332efc (diff) | |
download | rt.equinox.p2-0e91255ba25e817541b7db88f5a786c8d983773a.tar.gz rt.equinox.p2-0e91255ba25e817541b7db88f5a786c8d983773a.tar.xz rt.equinox.p2-0e91255ba25e817541b7db88f5a786c8d983773a.zip |
Bug 228931 Errors being logged when connecting to local update site without digest
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java index 5c7b5460d..44c22df91 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java @@ -319,15 +319,17 @@ public class UpdateSite { URL digestURL = getDigestURL(); digestFile = File.createTempFile("digest", ".zip"); //$NON-NLS-1$ //$NON-NLS-2$ BufferedOutputStream destination = new BufferedOutputStream(new FileOutputStream(digestFile)); - getTransport().download(digestURL.toExternalForm(), destination, null); - Feature[] result = new DigestParser().parse(digestFile); - if (result == null) + IStatus result = getTransport().download(digestURL.toExternalForm(), destination, null); + if (!result.isOK()) return null; - for (int i = 0; i < result.length; i++) { - String key = result[i].getId() + VERSION_SEPARATOR + result[i].getVersion(); - featureCache.put(key, result[i]); + Feature[] features = new DigestParser().parse(digestFile); + if (features == null) + return null; + for (int i = 0; i < features.length; i++) { + String key = features[i].getId() + VERSION_SEPARATOR + features[i].getVersion(); + featureCache.put(key, features[i]); } - return result; + return features; } catch (FileNotFoundException fnfe) { // we do not track FNF exceptions as we will fall back to the // standard feature parsing from the site itself, see bug 225587. |