Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Lindberg2009-04-15 14:41:42 +0000
committerHenrik Lindberg2009-04-15 14:41:42 +0000
commit9d71e42c8503ba2c111060c2b2fb1ec91eabedd9 (patch)
tree27f6d54cad7407461cbb89dcc3b8be3aa62cb3a4 /bundles/org.eclipse.equinox.p2.artifact.repository/src
parent9095af1a86743a238ef7eb465216a719fd50710a (diff)
downloadrt.equinox.p2-9d71e42c8503ba2c111060c2b2fb1ec91eabedd9.tar.gz
rt.equinox.p2-9d71e42c8503ba2c111060c2b2fb1ec91eabedd9.tar.xz
rt.equinox.p2-9d71e42c8503ba2c111060c2b2fb1ec91eabedd9.zip
Bug 237984 [transport] Use ECF to obtain the list of mirror
RepositoryTransport now support getting an InputStream that uses ECF for transport. It is used to get the list of mirrors. As a consequence, the new implementation supports authentication of the mirror list).
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java
index c57e9c78c..b6aca86e7 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Cloudsmith Inc - bug fixes
*******************************************************************************/
package org.eclipse.equinox.internal.p2.artifact.repository;
@@ -19,8 +20,10 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.internal.p2.repository.DownloadStatus;
+import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
import org.w3c.dom.*;
+import org.xml.sax.InputSource;
/**
* Mirror support class for repositories. This class implements
@@ -133,7 +136,12 @@ public class MirrorSelector {
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = domFactory.newDocumentBuilder();
- Document document = builder.parse(mirrorsURL);
+ Document document = null;
+ // Use Transport to read the mirrors list (to benefit from proxy support, authentication, etc)
+ RepositoryTransport transport = RepositoryTransport.getInstance();
+ InputSource input = new InputSource(mirrorsURL);
+ input.setByteStream(transport.stream(URIUtil.fromString(mirrorsURL)));
+ document = builder.parse(input);
if (document == null)
return null;
NodeList mirrorNodes = document.getElementsByTagName("mirror"); //$NON-NLS-1$

Back to the top