private boolean checkFileLevelRelativeToRoot(Path filePath, int depth) {
    if (filePath == null) {
      return false;
    }
    Path path = filePath;
    for (int i = 0; i < depth - 1; i++) {
      path = path.getParent();
    }
    if (!path.getName().equals(folderName)) {
      return false;
    }
    return true;
  }
private boolean checkFileLevelRelativeToRoot ( Path filePath , int depth ) { if ( filePath == null ) { return false ; } Path path = filePath ; for ( int i = 0 ; i < depth - 1 ; i ++ ) { path = path . getParent ( ) ; } if ( ! path . getName ( ) . equals ( folderName ) ) { return false ; } return true ; }
Helper to check if a file has proper hierarchy.
@param filePath path of the node/edge file
@param depth expected depth of the file
@return true if the file conforms to the expected hierarchy