public static void write(Path self, String text) throws IOException {
        Writer writer = null;
        try {
            writer = new OutputStreamWriter(Files.newOutputStream(self), Charset.defaultCharset());
            writer.write(text);
            writer.flush();

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

@param self a Path
@param text the text to write to the Path
@throws java.io.IOException if an IOException occurs.
@since 2.3.0