code: public static TFImportStatus checkAllModelsForImport(File directory) throws IOException {
          Preconditions.checkState(directory.isDirectory(), "Specified directory %s is not actually a directory", directory);
  
          Collection<File> files = FileUtils.listFiles(directory, new String[]{"pb"}, true);
          Preconditions.checkState(!files.isEmpty(), "No .pb files found in directory %s", directory);
  
          TFImportStatus status = null;
          for(File f : files){
              if(status == null){
                  status = checkModelForImport(f);
              } else {
                  status = status.merge(checkModelForImport(f));
              }
          }
          return status;
      }
docs: Recursively scan the specified directory for .pb files, and evaluate
  @param directory
  @return
  @throws IOException