public static void write ( Path self , String text , String charset ) throws IOException { Writer writer = null ; try { writer = new OutputStreamWriter ( Files . newOutputStream ( self , CREATE , APPEND ) , Charset . forName ( charset ) ) ; writer . write ( text ) ; writer . flush ( ) ; Writer temp = writer ; writer = null ; temp . close ( ) ; } finally { closeWithWarning ( writer ) ; } }
Write the text to the Path using the specified encoding .