public static PathFromRoot extractRootFromPath(@NotNull NewVirtualFileSystem vfs, @NotNull String path) {
    String normalizedPath = NewVirtualFileSystem.normalizePath(vfs, path);
    if (normalizedPath == null || normalizedPath.isBlank()) {
      return null;
    }

    String rootPath = NewVirtualFileSystem.extractRootPath(vfs, normalizedPath);
    if (rootPath.isBlank() || rootPath.length() > normalizedPath.length()) {
      LOG.warn(vfs + " has extracted incorrect root '" + rootPath + "' from '" + normalizedPath + "' (original '" + path + "')");
      return null;
    }

    NewVirtualFile root = ManagingFS.getInstance().findRoot(rootPath, vfs);
    if (root == null || !root.exists()) {
      return null;
    }

    int restPathStart = rootPath.length();
    if (restPathStart < normalizedPath.length() && normalizedPath.charAt(restPathStart) == '/') restPathStart++;
    return new PathFromRoot(root, normalizedPath.substring(restPathStart));
  }
public static PathFromRoot extractRootFromPath(@NotNull NewVirtualFileSystem vfs, @NotNull String path)