public static boolean isSubDirectoryOf(final Path workingDir, final Path rootDir) {
    return workingDir.toString().startsWith(rootDir.toString() + Path.SEPARATOR);
  }
Determines if the given workingDir is a subdirectory of the given "root directory"
@param workingDir a directory to check
@param rootDir    root directory of the HBase installation
@return true if the given workingDir is a subdirectory of the given root directory, false
        otherwise
hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotDescriptionUtils.java