public static void writeFile(String toWrite,String fileName) throws FileNotFoundException, UnsupportedEncodingException {
  logger.debug("Writing file: " + fileName);
  PrintWriter writer=null;
  try {
    writer=new PrintWriter(fileName,"UTF-8");
    writer.println(toWrite);
  }
  finally {
    if (writer != null) {
      writer.close();
    }
  }
}

public static void writeFile ( String toWrite , String fileName ) throws FileNotFoundException , UnsupportedEncodingException { logger . debug ( "Writing file: " + fileName ) ; PrintWriter writer = null ; try { writer = new PrintWriter ( fileName , "UTF-8" ) ; writer . println ( toWrite ) ; } finally { if ( writer != null ) { writer . close ( ) ; } } }
writes a file to the file system . used mainly for testing and some utils . could probably be better .
