code: public void toFile(File file, Engine engine) throws IOException {
          if (!file.createNewFile()) {
              FuzzyLite.logger().log(Level.FINE, "Replacing file: {0}", file.getAbsolutePath());
          }
          BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                  new FileOutputStream(file), FuzzyLite.UTF_8));
          try {
              writer.write(toString(engine));
          } catch (IOException ex) {
              throw ex;
          } finally {
              writer.close();
          }
      }
docs: Stores the string representation of the engine into the specified file
  
  @param file is the file to export the engine to
  @param engine is the engine to export
  @throws IOException if any problem occurs upon creation or writing to the
  file