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.proxy.model.ProxyFetchResult;
import org.apache.archiva.proxy.model.ProxyConnector;
+import org.apache.archiva.proxy.model.ProxyFetchResult;
import org.apache.archiva.proxy.model.RepositoryProxyConnectors;
import org.apache.archiva.redback.components.registry.Registry;
import org.apache.archiva.redback.components.registry.RegistryListener;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.TimeUnit;
/**
* DefaultRepositoryProxyConnectors
}
// Convert seconds to milliseconds
- int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000;
+ long timeoutInMilliseconds = TimeUnit.MILLISECONDS.convert( remoteRepository.getRepository().getTimeout(), //
+ TimeUnit.SECONDS );
// Set timeout read and connect
// FIXME olamy having 2 config values
- wagon.setReadTimeout( timeoutInMilliseconds );
- wagon.setTimeout( timeoutInMilliseconds );
+ wagon.setReadTimeout( (int) timeoutInMilliseconds );
+ wagon.setTimeout( (int) timeoutInMilliseconds );
try
{
@Override
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{
- if ( ConfigurationNames.isNetworkProxy( propertyName ) || ConfigurationNames.isManagedRepositories(
- propertyName ) || ConfigurationNames.isRemoteRepositories( propertyName )
- || ConfigurationNames.isProxyConnector( propertyName ) )
+ if ( ConfigurationNames.isNetworkProxy( propertyName ) //
+ || ConfigurationNames.isManagedRepositories( propertyName ) //
+ || ConfigurationNames.isRemoteRepositories( propertyName ) //
+ || ConfigurationNames.isProxyConnector( propertyName ) ) //
{
initConnectorsAndNetworkProxies();
}