@ApiStatus.Experimental
  public static boolean pathEqualsTo(@NotNull VirtualFile file, @NotNull @SystemIndependent String path) {
    path = FileUtil.toCanonicalPath(path);
    int li = path.length();
    while (file != null && li != -1) {
      int sepIndex = path.lastIndexOf('/', li - 1);
      CharSequence fileName = file.getNameSequence();
      int fileNameEnd = fileName.length() + (StringUtil.endsWithChar(fileName, '/') ? -1 : 0);
      if (sepIndex == 6 && StringUtil.startsWith(fileName, "//wsl$")) {
        sepIndex = -1;
      }
      if (!CharArrayUtil.regionMatches(fileName, 0, fileNameEnd, path, sepIndex + 1, li, file.isCaseSensitive())) {
        return false;
      }
      file = file.getParent();
      li = sepIndex;
    }
    return li == -1 && file == null;
  }
@ApiStatus.Experimental
  public static boolean pathEqualsTo(@NotNull VirtualFile file, @NotNull @SystemIndependent String path)