code: private String getCommonRootDir(String filePath, HashMap validFilePaths) {
          for (Iterator it = validFilePaths.entrySet().iterator(); it.hasNext();) {
              Map.Entry entry = (Map.Entry) it.next();
              String path = (String) ((entry).getKey());
              if (filePath.startsWith(path))
                  return (String) entry.getValue();
          }
  
          return null;
      }
docs: Retrieves the directory in common between the specified path and the archive root directory.
  If the file path cannot be found among the valid paths then null is returned.
  
  @param filePath       Path to the file to check
  @param validFilePaths A list of valid file paths and their common directories with the root
  @return The directory in common between the specified path and the root directory