code: public static File copy(Reader reader) throws IOException
    {
      File file = createTempFile();
      copy(reader, new FileWriter(file));
      return file;
    }
docs: Copy text from character stream to temporary file then close both the source reader and temporary file. Be aware
  that temporary file is removed at JVM exit.
  
  @param reader source character reader.
  @return the newly created temporarily file.
  @throws IOException if copy operation fails.