class ZipUtils {

  public static void getResources(ZipFile zip, Pattern filter, Consumer<InputStream> consumer)
      throws IOException {
    Enumeration<? extends ZipEntry> zipEntries = zip.entries();
    while (zipEntries.hasMoreElements()) {
      ZipEntry zipEntry = zipEntries.nextElement();
      final String name = zipEntry.getName();
      if (filter.matcher(name).matches()) {
        try (InputStream in = zip.getInputStream(zipEntry)) {
          consumer.accept(in);
        }
      }
    }
  }

  private  ZipUtils();

}