public static Map<String,byte[]> readZipFromResource(String path) throws IOException {
  ClassLoader cl=ClassLoader.getSystemClassLoader();
  URL url=cl.getResource(path);
  Validate.isTrue(url != null);
  Map<String,byte[]> ret=new LinkedHashMap<>();
  try (InputStream is=url.openStream();ZipArchiveInputStream zais=new ZipArchiveInputStream(is)){
    ZipArchiveEntry entry;
    while ((entry=zais.getNextZipEntry()) != null) {
      ret.put(entry.getName(),IOUtils.toByteArray(zais));
    }
  }
   return ret;
}

public static Map < String , byte [ ] > readZipFromResource ( String path ) throws IOException { ClassLoader cl = ClassLoader . getSystemClassLoader ( ) ; URL url = cl . getResource ( path ) ; Validate . isTrue ( url != null ) ; Map < String , byte [ ] > ret = new LinkedHashMap < > ( ) ; try ( InputStream is = url . openStream ( ) ; ZipArchiveInputStream zais = new ZipArchiveInputStream ( is ) ) { ZipArchiveEntry entry ; while ( ( entry = zais . getNextZipEntry ( ) ) != null ) { ret . put ( entry . getName ( ) , IOUtils . toByteArray ( zais ) ) ; } } return ret ; }
loads up a zip file that ' s contained in the classpath .
