try
{
target.getParentFile().mkdirs();
writer = new FileWriter( target );
MetadataXpp3Writer mappingWriter = new MetadataXpp3Writer();
<BUG>mappingWriter.write( writer, targetMetadata );
}</BUG>
finally
{
IOUtil.close( writer );

try
{
reader = new FileReader( source );
writer = new FileWriter( target );
IOUtil.copy( reader, writer );
}
finally
{
IOUtil.close( reader );
IOUtil.close( writer );
