public static PrintWriter openPrintWriterToFile(File file,boolean verbose) throws AdeUsageException {
  try {
    if (verbose) {
      logger.info("Opening " + file.getPath());
    }
    return new PrintWriter(file,FILE_ENCODING);
  }
 catch (  FileNotFoundException e) {
    throw new AdeUsageException("Cannot open file " + file.getPath(),e);
  }
catch (  UnsupportedEncodingException e) {
    throw new AdeUsageException("Platform does not support encoding " + FILE_ENCODING,e);
  }
}

public static PrintWriter openPrintWriterToFile ( File file , boolean verbose ) throws AdeUsageException { try { if ( verbose ) { logger . info ( "Opening " + file . getPath ( ) ) ; } return new PrintWriter ( file , FILE_ENCODING ) ; } catch ( FileNotFoundException e ) { throw new AdeUsageException ( "Cannot open file " + file . getPath ( ) , e ) ; } catch ( UnsupportedEncodingException e ) { throw new AdeUsageException ( "Platform does not support encoding " + FILE_ENCODING , e ) ; } }
return a printwriter ready to write to a specified file .
