code: public static void writeFile(VirtualFile virtualFile, InputStream is) throws IOException {
          final File file = virtualFile.getPhysicalFile();
          file.getParentFile().mkdirs();
          final FileOutputStream fos = new FileOutputStream(file);
          copyStreamAndClose(is, fos);
      }
docs: Write the content from the given {@link InputStream} to the given virtual file, replacing its current contents (if any) or creating a new file if
  one does not exist.
  
  @param virtualFile the virtual file to write
  @param is          the input stream
  @throws IOException if an error occurs