{
String projectSpec =
SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr );
if ( projectSpec == null )
{
throw new ScmException( "You should checkout a working project first" );
}
File waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr );
File destPath = new File( waPath, repo.getProjectName() );
for ( File f : fileSet.getFileList() )
{
File source = new File( fileSet.getBasedir(), f.getPath() );
File dest = new File( destPath, f.getPath() );
SynergyUtil.delete( getLogger(), dest, ccmAddr, true );
if ( !source.equals( dest ) )
{
if ( getLogger().isDebugEnabled() )
{
getLogger().debug( "Copy file [" + dest + "] to [" + source + "]." );
}
try
{
FileUtils.copyFile( dest, source );
}
catch ( IOException e )
{
throw new ScmException( "Unable to restore file in output folder", e );
}
}
}
}
finally