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 ( ) ; } }
Stores the string representation of the engine into the specified file