Apache Commons IO is a java library with simple IO utilities and filters.
This requires the library commons-io-2.1.jar to be in classpath.
The following example shows using FileUtils.write() API.
File toFile = new File("C:/Test/rule_engine_names2.txt");
FileUtils.write(toFile, fileContent, "UTF-8");
System.out.println("Successfully written the file");
}
}