code: 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);
          }
      }
docs: Write the text to the Path, using the specified encoding.
  
  @param self    a Path
  @param text    the text to write to the Path
  @param charset the charset used
  @throws java.io.IOException if an IOException occurs.
  @since 2.3.0