class ProductCatalogManager {

   protected Resource getNewestResource(Resource rez) {
      List<Resource> files = rez.listResources();

      if (files != null && files.size() > 0) {
         List<Resource> sorted = files.stream().sorted(Comparator.comparing((Resource r1) -> getProdCatVersion(r1)).reversed()).collect(Collectors.toList()); // reverse sort: Largest first 
         rez = sorted.get(0);
      }

      return rez; // if files is null or empty, rez is probably a file instead of a directory.
   }

   @Inject public  ProductCatalogManager(ProductCatalogConfig config);
   public  ProductCatalogManager(Resource catalogResource);

}