}
File localFile;
try
{
BidirectionalRepositoryLayout sourceLayout = layoutFactory.getLayout( repository.getLayoutType() );
String sourcePath = sourceLayout.toPath( artifact );
localFile = new File( repository.getUrl().getPath(), sourcePath );
}
catch ( LayoutException e )
{
throw new ProxyException( "Unable to proxy due to bad source repository layout definition: "
+ e.getMessage(), e );
}
Properties requestProperties = new Properties();
requestProperties.setProperty( "version", artifact.getVersion() );
List connectors = getProxyConnectors( repository );
Iterator it = connectors.iterator();
while ( it.hasNext() )
{
ProxyConnector connector = (ProxyConnector) it.next();
getLogger().debug( "Attempting connector: " + connector );
ArchivaRepository targetRepository = connector.getTargetRepository();
try
{
BidirectionalRepositoryLayout targetLayout = layoutFactory.getLayout( targetRepository.getLayoutType() );
String targetPath = targetLayout.toPath( artifact );
getLogger().debug(
"Using target repository: " + targetRepository.getId() + " - layout: "
+ targetRepository.getLayoutType() + " - targetPath: " + targetPath );