public static boolean isStartingWithPath(final Path rootPath, final String path) {
    String uriRootPath = rootPath.toUri().getPath();
    String tailUriPath = new Path(path).toUri().getPath();
    return tailUriPath.startsWith(uriRootPath);
  }
Compare of path component. Does not consider schema; i.e. if schemas different but
<code>path</code> starts with <code>rootPath</code>, then the function returns true
@param rootPath value to check for
@param path     subject to check
@return True if <code>path</code> starts with <code>rootPath</code>
hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java