private static void collectDeletedPathsOnFileRename(@NotNull VFilePropertyChangeEvent event, @NotNull Collection<? super File> filesDeleted) {
    final VirtualFile eventFile = event.getFile();
    final VirtualFile parent = eventFile.getParent();
    if (parent != null) {
      final String oldName = (String)event.getOldValue();
      final String root = parent.getPath() + "/" + oldName;
      if (eventFile.isDirectory()) {
        VfsUtilCore.visitChildrenRecursively(eventFile, new VirtualFileVisitor<Void>() {
          private final StringBuilder filePath = new StringBuilder(root);

          @Override
          public boolean visitFile(@NotNull VirtualFile child) {
            ProgressManager.checkCanceled();
            if (child.isDirectory()) {
              if (!child.equals(eventFile)) {
                filePath.append("/").append(child.getName());
              }
            }
            else {
              String childPath = filePath.toString();
              if (!child.equals(eventFile)) {
                childPath += "/" + child.getName();
              }
              filesDeleted.add(new File(childPath));
            }
            return true;
          }

          @Override
          public void afterChildrenVisited(@NotNull VirtualFile file) {
            if (file.isDirectory() && !file.equals(eventFile)) {
              filePath.delete(filePath.length() - file.getName().length() - 1, filePath.length());
            }
          }
        });
      }
      else {
        filesDeleted.add(new File(root));
      }
    }
  }
private static void collectDeletedPathsOnFileRename(@NotNull VFilePropertyChangeEvent event, @NotNull Collection<? super File> filesDeleted)