code: private boolean isEntryInDir(Set<String> dirNames, String entryName) {
      // this should be done with a trie, put dirNames in a trie and check if entryName leads to
      // some node or not.
      for(String dirName : dirNames) {
        if (entryName.startsWith(dirName)) {
          return true;
        }
      }
      return false;
    }
docs: Checks if entry given by name resides inside of one of the dirs.
  
  @param dirNames dirs
  @param entryName entryPath