summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-proxy-common
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-10-31 21:40:38 +0000
committerOlivier Lamy <olamy@apache.org>2012-10-31 21:40:38 +0000
commit27c8f4047caf10fa1a0db28e61f2170faa437785 (patch)
tree5c217ce28db94f3212be0f80cf4a0bd334281002 /archiva-modules/archiva-base/archiva-proxy-common
parent94a06383442913ff468844b235b52a77d0a230b6 (diff)
downloadarchiva-27c8f4047caf10fa1a0db28e61f2170faa437785.tar.gz
archiva-27c8f4047caf10fa1a0db28e61f2170faa437785.zip
move ntlm wagon trick in wagonFactory to avoid duplicate code
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1404367 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy-common')
-rw-r--r--archiva-modules/archiva-base/archiva-proxy-common/pom.xml5
-rwxr-xr-xarchiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java7
-rw-r--r--archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java20
3 files changed, 32 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy-common/pom.xml b/archiva-modules/archiva-base/archiva-proxy-common/pom.xml
index b55beafeb..cc3285a0e 100644
--- a/archiva-modules/archiva-base/archiva-proxy-common/pom.xml
+++ b/archiva-modules/archiva-base/archiva-proxy-common/pom.xml
@@ -33,6 +33,10 @@
<artifactId>archiva-plexus-bridge</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-admin-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
</dependency>
@@ -87,6 +91,7 @@
org.springframework.stereotype;version="[3,4)",
org.springframework.context;version="[3,4)",
org.springframework.beans;version="[3,4)",
+ org.apache.archiva.admin.model.beans;version=${project.version},
org.apache.maven.wagon*,
org.slf4j;resolution:=optional
</Import-Package>
diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java
index 8d711b82e..50e9d616c 100755
--- a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java
+++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/DefaultWagonFactory.java
@@ -62,6 +62,13 @@ public class DefaultWagonFactory
? wagonFactoryRequest.getProtocol()
: "wagon#" + wagonFactoryRequest.getProtocol();
+ // if it's a ntlm proxy we have to lookup the wagon light which support thats
+ // wagon http client doesn't support that
+ if ( wagonFactoryRequest.getNetworkProxy() != null && wagonFactoryRequest.getNetworkProxy().isUseNtlm() )
+ {
+ protocol = protocol + "-ntlm";
+ }
+
Wagon wagon = applicationContext.getBean( protocol, Wagon.class );
wagon.addTransferListener( debugTransferListener );
configureUserAgent( wagon, wagonFactoryRequest );
diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
index 13ffce6d0..613f20cde 100644
--- a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
+++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java
@@ -18,6 +18,8 @@ package org.apache.archiva.proxy.common;
* under the License.
*/
+import org.apache.archiva.admin.model.beans.NetworkProxy;
+
import java.util.HashMap;
import java.util.Map;
@@ -37,6 +39,8 @@ public class WagonFactoryRequest
private String userAgent = "Java-Archiva";
+ private NetworkProxy networkProxy;
+
public WagonFactoryRequest()
{
// no op
@@ -100,6 +104,22 @@ public class WagonFactoryRequest
return this;
}
+ public NetworkProxy getNetworkProxy()
+ {
+ return networkProxy;
+ }
+
+ public void setNetworkProxy( NetworkProxy networkProxy )
+ {
+ this.networkProxy = networkProxy;
+ }
+
+ public WagonFactoryRequest networkProxy( NetworkProxy networkProxy )
+ {
+ this.networkProxy = networkProxy;
+ return this;
+ }
+
@Override
public boolean equals( Object o )
{