}
File localFile;
try
{
BidirectionalRepositoryLayout sourceLayout = layoutFactory.getLayout( repository.getLayoutType() );
String sourcePath = sourceLayout.toPath( metadata );
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();
List connectors = getProxyConnectors( repository );
Iterator it = connectors.iterator();
while ( it.hasNext() )
{
ProxyConnector connector = (ProxyConnector) it.next();
ArchivaRepository targetRepository = connector.getTargetRepository();
try
{
BidirectionalRepositoryLayout targetLayout = layoutFactory.getLayout( targetRepository.getLayoutType() );
String targetPath = targetLayout.toPath( metadata );
File downloadedFile = transferFile( connector, targetRepository, targetPath, localFile,
requestProperties );
if ( fileExists( downloadedFile ) )