diff options
author | Olivier Lamy <olamy@apache.org> | 2015-01-29 16:47:38 +1100 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2015-01-29 16:47:38 +1100 |
commit | 1040ab6f74be7824731912ecae1eec1de495ae19 (patch) | |
tree | b478c300deaddae5798a0b653d3d2d2bf8cd05f5 /archiva-modules | |
parent | 1d2408e1fd088d3fbf9e71a3784077f86b89aa0b (diff) | |
download | archiva-1040ab6f74be7824731912ecae1eec1de495ae19.tar.gz archiva-1040ab6f74be7824731912ecae1eec1de495ae19.zip |
formatting
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java index 92508bfb5..64b8043c7 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java @@ -25,26 +25,20 @@ import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin; import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.proxy.common.WagonFactory; -import org.apache.archiva.proxy.common.WagonFactoryException; import org.apache.archiva.proxy.common.WagonFactoryRequest; import org.apache.archiva.rest.api.services.ArchivaRestServiceException; import org.apache.archiva.rest.api.services.RemoteRepositoriesService; import org.apache.commons.lang.StringUtils; -import org.apache.maven.wagon.ResourceDoesNotExistException; -import org.apache.maven.wagon.StreamWagon; import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.Wagon; -import org.apache.maven.wagon.authorization.AuthorizationException; import org.apache.maven.wagon.providers.http.AbstractHttpClientWagon; import org.apache.maven.wagon.providers.http.HttpConfiguration; import org.apache.maven.wagon.providers.http.HttpMethodConfiguration; -import org.apache.maven.wagon.providers.http.HttpWagon; import org.apache.maven.wagon.repository.Repository; import org.springframework.stereotype.Service; import javax.inject.Inject; import javax.ws.rs.core.Response; -import java.net.MalformedURLException; import java.net.URL; import java.util.Collections; import java.util.List; @@ -172,9 +166,9 @@ public class DefaultRemoteRepositoriesService String wagonProtocol = new URL( remoteRepository.getUrl() ).getProtocol(); - final Wagon wagon = wagonFactory.getWagon( - new WagonFactoryRequest( wagonProtocol, remoteRepository.getExtraHeaders() ).networkProxy( - networkProxy ) ); + final Wagon wagon = + wagonFactory.getWagon( new WagonFactoryRequest( wagonProtocol, remoteRepository.getExtraHeaders() ) // + .networkProxy( networkProxy ) ); // hardcoded value as it's a check of the remote repo connectivity wagon.setReadTimeout( 4000 ); @@ -182,11 +176,10 @@ public class DefaultRemoteRepositoriesService if ( wagon instanceof AbstractHttpClientWagon ) { - HttpConfiguration httpConfiguration = new HttpConfiguration(); - HttpMethodConfiguration httpMethodConfiguration = new HttpMethodConfiguration(); - httpMethodConfiguration.setUsePreemptive( true ); - httpMethodConfiguration.setReadTimeout( 4000 ); - httpConfiguration.setGet( httpMethodConfiguration ); + HttpMethodConfiguration httpMethodConfiguration = new HttpMethodConfiguration() // + .setUsePreemptive( true ) // + .setReadTimeout( 4000 ); + HttpConfiguration httpConfiguration = new HttpConfiguration().setGet( httpMethodConfiguration ); AbstractHttpClientWagon.class.cast( wagon ).setHttpConfiguration( httpConfiguration ); } |