docs: protected String determineRootDir(String location) {
          int prefixEnd = location.indexOf(":") + 1;
          int rootDirEnd = location.length();
          while (rootDirEnd > prefixEnd && getPathMatcher().isPattern(location.substring(prefixEnd, rootDirEnd))) {
              rootDirEnd = location.lastIndexOf('/', rootDirEnd - 2) + 1;
          }
          if (rootDirEnd == 0) {
              rootDirEnd = prefixEnd;
          }
          return location.substring(0, rootDirEnd);
      }