private static void writeFile(String path, String text, Project project, String prefix, Compressor zip, boolean overwrite) throws IOException {
    VirtualFile descriptionFile = getDescriptionFile(project, path);
    if (descriptionFile == null) {
      zip.addFile(prefix + '/' + path, text.getBytes(StandardCharsets.UTF_8));
    }
    else if (overwrite) {
      Ref<IOException> exceptionRef = Ref.create();
      ApplicationManager.getApplication().invokeAndWait(() -> {
        try {
          WriteAction.run(() -> VfsUtil.saveText(descriptionFile, text));
        }
        catch (IOException e) {
          exceptionRef.set(e);
        }
      });
      IOException e = exceptionRef.get();
      if (e != null) throw e;
    }
  }
private static void writeFile(String path, String text, Project project, String prefix, Compressor zip, boolean overwrite)