private static void writeRename(@NotNull VirtualFile virtualFile, @NotNull FilePath filePath) throws IOException {
      FilePath parentPath = filePath.getParentPath();
      if (parentPath != null) {
        VirtualFile parentFile = VfsUtil.createDirectories(parentPath.getPath());
        if (parentFile != null && !parentFile.equals(virtualFile.getParent())) {
          virtualFile.move(MyWriteVersionTask.class, parentFile);
        }
      }

      if (!virtualFile.getName().equals(filePath.getName())) {
        virtualFile.rename(MyWriteVersionTask.class, filePath.getName());
      }
    }
private static void writeRename(@NotNull VirtualFile virtualFile, @NotNull FilePath filePath)