private void closeWriter(Writer writer){
  if (writer != null) {
    try {
      writer.close();
    }
 catch (    IOException e) {
      log.error(e);
    }
  }
}

private void closeWriter ( Writer writer ) { if ( writer != null ) { try { writer . close ( ) ; } catch ( IOException e ) { log . error ( e ) ; } } }
close file writer if the writer is not null .
