question: public static void writeStringToFile ( Path file , String text ) throws IOException { byte [ ] buf = text . getBytes ( StandardCharsets . UTF_8 ) ; Files . write ( file , buf ) ; }
target:  Java NIO replacement of commons-io