private static boolean validatePath(Path coprocPath, Path wlPath) {
    // verify if all are allowed
    if (wlPath.toString().equals("*")) {
      return (true);
    }

    // verify we are on the same filesystem if wlPath has a scheme
    if (!wlPath.isAbsoluteAndSchemeAuthorityNull()) {
      String wlPathScheme = wlPath.toUri().getScheme();
      String coprocPathScheme = coprocPath.toUri().getScheme();
      String wlPathHost = wlPath.toUri().getHost();
      String coprocPathHost = coprocPath.toUri().getHost();
      if (wlPathScheme != null) {
        wlPathScheme = wlPathScheme.toString().toLowerCase();
      } else {
        wlPathScheme = "";
      }
      if (wlPathHost != null) {
        wlPathHost = wlPathHost.toString().toLowerCase();
      } else {
        wlPathHost = "";
      }
      if (coprocPathScheme != null) {
        coprocPathScheme = coprocPathScheme.toString().toLowerCase();
      } else {
        coprocPathScheme = "";
      }
      if (coprocPathHost != null) {
        coprocPathHost = coprocPathHost.toString().toLowerCase();
      } else {
        coprocPathHost = "";
      }
      if (!wlPathScheme.equals(coprocPathScheme) || !wlPathHost.equals(coprocPathHost)) {
        return (false);
      }
    }

    // allow any on this file-system (file systems were verified to be the same above)
    if (wlPath.isRoot()) {
      return (true);
    }

    // allow "loose" matches stripping scheme
    if (
      FilenameUtils.wildcardMatch(Path.getPathWithoutSchemeAndAuthority(coprocPath).toString(),
        Path.getPathWithoutSchemeAndAuthority(wlPath).toString())
    ) {
      return (true);
    }
    return (false);
  }
Validates a single whitelist path against the coprocessor path
@param coprocPath the path to the coprocessor including scheme
@param wlPath     can be: 1) a "*" to wildcard all coprocessor paths 2) a specific filesystem
                  (e.g. hdfs://my-cluster/) 3) a wildcard path to be evaluated by
                  {@link FilenameUtils#wildcardMatch(String, String)} path can specify scheme
                  or not (e.g. "file:///usr/hbase/coprocessors" or for all filesystems
                  "/usr/hbase/coprocessors")
@return if the path was found under the wlPath
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/CoprocessorWhitelistMasterObserver.java