Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2010-05-19 16:20:19 -0400
committerIan Bull2010-05-19 16:20:19 -0400
commitc06094fec76d3f09b860bbd255332a7a44bfbda2 (patch)
tree4307855e658dfe093a6e0bc0541d2b4aeef19e9c /bundles/org.eclipse.equinox.p2.repository
parent0ca0650aa0828a8d0e0913f655accc59e542a3f5 (diff)
downloadrt.equinox.p2-c06094fec76d3f09b860bbd255332a7a44bfbda2.tar.gz
rt.equinox.p2-c06094fec76d3f09b860bbd255332a7a44bfbda2.tar.xz
rt.equinox.p2-c06094fec76d3f09b860bbd255332a7a44bfbda2.zip
bug 306816: [regression] p2 activates UI plugins via org.eclipse.ui.net proxy support
https://bugs.eclipse.org/bugs/show_bug.cgi?id=306816
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
index 9736154cf..b359e26df 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
@@ -11,8 +11,7 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.repository.helpers;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
+import java.io.*;
import java.lang.ref.SoftReference;
import java.net.*;
import java.util.*;
@@ -690,9 +689,31 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
* a NullSafe version is returned.
*/
private LocationProperties loadIndexFile(URI location, IProgressMonitor monitor) {
- // get the search order from the server, if it's available
- ByteArrayOutputStream index = new ByteArrayOutputStream();
LocationProperties locationProperties = LocationProperties.createEmptyIndexFile();
+ //Handle the case of local repos
+ if ("file".equals(location.getScheme())) { //$NON-NLS-1$
+ InputStream localStream = null;
+ try {
+ try {
+ File indexFile = URIUtil.toFile(getIndexFileURI(location));
+ if (indexFile != null && indexFile.exists() && indexFile.canRead()) {
+ localStream = new FileInputStream(indexFile);
+ locationProperties = LocationProperties.create(localStream);
+ }
+ } catch (URISyntaxException e) {
+ LogHelper.log(new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e));
+ } finally {
+ if (localStream != null)
+ localStream.close();
+ }
+ } catch (IOException e) {
+ //do nothing.
+ }
+ return locationProperties;
+ }
+
+ //Handle non local repos (i.e. not file:)
+ ByteArrayOutputStream index = new ByteArrayOutputStream();
IStatus indexFileStatus = null;
try {
indexFileStatus = getTransport().download(getIndexFileURI(location), index, monitor);
@@ -700,7 +721,6 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
LogHelper.log(new Status(IStatus.ERROR, Activator.ID, uriSyntaxException.getMessage(), uriSyntaxException));
indexFileStatus = null;
}
-
if (indexFileStatus != null && indexFileStatus.isOK())
locationProperties = LocationProperties.create(new ByteArrayInputStream(index.toByteArray()));

Back to the top