in src/main/java/org/apache/maven/plugin/patch/ApplyMojo.java [513:550]
private void writeTrackingFile( Map patchesApplied )
throws MojoExecutionException
{
FileWriter writer = null;
try
{
boolean appending = patchTrackingFile.exists();
writer = new FileWriter( patchTrackingFile, appending );
for ( Iterator it = patchesApplied.keySet().iterator(); it.hasNext(); )
{
if ( appending )
{
writer.write( System.getProperty( "line.separator" ) );
}
String patch = (String) it.next();
writer.write( patch );
if ( it.hasNext() )
{
writer.write( System.getProperty( "line.separator" ) );
}
}
writer.close();
writer = null;
}
catch ( IOException e )
{
throw new MojoExecutionException( "Failed to write patch-tracking file: " + patchTrackingFile, e );
}
finally
{
IOUtil.close( writer );
}
}