basedir.mkdirs();
String protocol = sourceRepository.getProtocol();
Wagon sourceWagon = wagonManager.getWagon( sourceRepository );
AuthenticationInfo sourceAuth = wagonManager.getAuthenticationInfo( sourceRepository.getId() );
sourceWagon.connect( sourceRepository, sourceAuth );
logger.info( "Looking for files in the source repository." );
List files = new ArrayList();
scan( sourceWagon, "", files );
logger.info( "Downloading files from the source repository to: " + basedir );
for ( Iterator i = files.iterator(); i.hasNext(); )
{
String s = (String) i.next();
if ( s.indexOf( ".svn" ) >= 0 )
{
continue;
}
File f = new File( basedir, s );
FileUtils.mkdir( f.getParentFile().getAbsolutePath() );
logger.info( "Downloading file from the source repository: " + s );
sourceWagon.get( s, f );
}
// ----------------------------------------------------------------------------
// Now all the files are present locally and now we are going to grab the
// metadata files from the targetRepositoryUrl and pull those down locally
// so that we can merge the metadata.
// ----------------------------------------------------------------------------
logger.info( "Downloading metadata from the target repository." );
Wagon targetWagon = wagonManager.getWagon( targetRepository );
if ( ! ( targetWagon instanceof CommandExecutor ) )
{
throw new CommandExecutionException( "Wagon class '" + targetWagon.getClass().getName() +
"' in use for target repository is not a CommandExecutor" );
}
AuthenticationInfo targetAuth = wagonManager.getAuthenticationInfo( targetRepository.getId() );
targetWagon.connect( targetRepository, targetAuth );
PrintWriter rw = new PrintWriter( new FileWriter( renameScript ) );