diff options
author | Olivier Lamy <olamy@apache.org> | 2012-02-17 11:36:20 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-02-17 11:36:20 +0000 |
commit | 63964ffef4f608d610b621337e32ed1aace36d91 (patch) | |
tree | 3f883899354ec6b4a57d743d94435c621f330292 /archiva-modules | |
parent | 53f479e409b750b2c0c5c883ddd94b9bf0ba72bd (diff) | |
download | archiva-63964ffef4f608d610b621337e32ed1aace36d91.tar.gz archiva-63964ffef4f608d610b621337e32ed1aace36d91.zip |
[MRM-1606] Upgrade to wagon 2.2.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245404 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
3 files changed, 9 insertions, 22 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java index cbdd6948c..d0db565f1 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -1109,7 +1109,9 @@ public class DefaultRepositoryProxyConnectors // Convert seconds to milliseconds int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000; - // Set timeout + // Set timeout read and connect + // FIXME olamy having 2 config values + wagon.setReadTimeout( timeoutInMilliseconds ); wagon.setTimeout( timeoutInMilliseconds ); try diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java index c9553082d..b348ab2f4 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java @@ -41,8 +41,6 @@ import org.apache.maven.wagon.events.TransferEvent; import org.apache.maven.wagon.events.TransferListener; import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.repository.Repository; -import org.apache.maven.wagon.shared.http.HttpConfiguration; -import org.apache.maven.wagon.shared.http.HttpMethodConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,7 +49,6 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.util.Arrays; @@ -132,7 +129,10 @@ public class DownloadRemoteIndexTask && this.networkProxy.isUseNtlm() ) ? "-ntlm" : "" ); final Wagon wagon = wagonFactory.getWagon( wagonProtocol ); - setupWagonReadTimeout( wagon ); + int timeoutInMilliseconds = remoteRepository.getTimeout() * 1000; + // FIXME olamy having 2 config values + wagon.setReadTimeout( timeoutInMilliseconds ); + wagon.setTimeout( timeoutInMilliseconds ); wagon.addTransferListener( new DownloadListener() ); ProxyInfo proxyInfo = null; @@ -220,22 +220,6 @@ public class DownloadRemoteIndexTask } } - private void setupWagonReadTimeout( Wagon wagon ) - { - try - { - HttpConfiguration httpConfiguration = new HttpConfiguration().setAll( - new HttpMethodConfiguration().setReadTimeout( remoteRepository.getRemoteDownloadTimeout() * 1000 ) ); - Method setHttpConfigurationMethod = - wagon.getClass().getMethod( "setHttpConfiguration", HttpConfiguration.class ); - setHttpConfigurationMethod.invoke( wagon, httpConfiguration ); - } - catch ( Exception e ) - { - log.debug( "unable to set download remote time out for index {}", e.getMessage(), e ); - } - } - public static class DownloadListener implements TransferListener diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java index e1057bfb8..2bbde57c1 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java @@ -309,8 +309,9 @@ public class RepositoryModelResolver // Convert seconds to milliseconds int timeoutInMilliseconds = remoteRepository.getTimeout() * 1000; - + // FIXME olamy having 2 config values // Set timeout + wagon.setReadTimeout( timeoutInMilliseconds ); wagon.setTimeout( timeoutInMilliseconds ); try |