public static @Nullable String extractRootPath(@NotNull String normalizedPath) {
    if (SystemInfoRt.isWindows) {
      if (OSAgnosticPathUtil.startsWithWindowsDrive(normalizedPath)) {
        // drive letter
        return StringUtil.toUpperCase(normalizedPath.substring(0, 2));
      }
      if (normalizedPath.startsWith("//")) {
        // UNC (https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/62e862f4-2a51-452e-8eeb-dc4ff5ee33cc)
        int p1 = normalizedPath.indexOf('/', 2);
        if (p1 > 2) {
          if (PathUtilRt.isWindowsUNCRoot(normalizedPath, p1)) {
            int p2 = normalizedPath.indexOf('/', p1 + 1);
            if (p2 > p1 + 1) return normalizedPath.substring(0, p2);
            if (p2 < 0) return normalizedPath;
          }
          // else the path doesn't look like UNC, e.g. "//.."
        }
      }
    }
    else if (StringUtil.startsWithChar(normalizedPath, '/')) {
      return "/";
    }
    int sc = normalizedPath.indexOf(URLUtil.SCHEME_SEPARATOR);
    if (sc != -1) {
      return normalizedPath.substring(0, sc + URLUtil.SCHEME_SEPARATOR.length());
    }

    return null;
  }
public static @Nullable String extractRootPath(@NotNull String normalizedPath)