long originalTimestamp = getLastModified( localFile );
List<ProxyConnector> connectors = getProxyConnectors( repository );
for ( ProxyConnector connector : connectors )
{
RemoteRepositoryContent targetRepository = connector.getTargetRepository();
String targetPath = metadataTools.toPath( metadata );
File localRepoFile = toLocalRepoFile( repository, targetRepository, targetPath );
long originalMetadataTimestamp = getLastModified( localRepoFile );
try
{
transferFile( connector, targetRepository, targetPath, localRepoFile, requestProperties );
if ( hasBeenUpdated( localRepoFile, originalMetadataTimestamp ) )
{
metadataNeedsUpdating = true;
}
}
catch ( NotFoundException e )
{
getLogger().debug( "Versioned Metadata " + Keys.toKey( metadata )
+ " not found on remote repository \""
+ targetRepository.getRepository().getId() + "\"." );
}
catch ( NotModifiedException e )
{
getLogger().debug( "Versioned Metadata " + Keys.toKey( metadata )
+ " not updated on remote repository \""
+ targetRepository.getRepository().getId() + "\"." );
}
catch ( ProxyException e )
{
getLogger().warn( "Transfer error from repository \"" + targetRepository.getRepository().getId() +
"\" for versioned Metadata " + Keys.toKey( metadata ) +
", continuing to next repository. Error message: " + e.getMessage() );
getLogger().debug( "Full stack trace", e );
}
}