private void writeStringToFile(String str,File file) throws IOException {
  if (!file.exists() && file.isDirectory()) {
    return;
  }
  try (BufferedWriter bw=new BufferedWriter(WriterFactory.newWriter(file,this.encoding))){
    bw.write(str);
  }
 }

private void writeStringToFile ( String str , File file ) throws IOException { if ( ! file . exists ( ) && file . isDirectory ( ) ) { return ; } try ( BufferedWriter bw = new BufferedWriter ( WriterFactory . newWriter ( file , this . encoding ) ) ) { bw . write ( str ) ; } }
write the given string to a file .
