private static ImmutableSet < String > readDelTemplatesFromMetaInf ( ClassLoader loader ) { try { ImmutableSet . Builder < String > builder = ImmutableSet . builder ( ) ; Enumeration < URL > resources = loader . getResources ( Names . META_INF_DELTEMPLATE_PATH ) ; while ( resources . hasMoreElements ( ) ) { URL url = resources . nextElement ( ) ; try ( InputStream in = url . openStream ( ) ) { BufferedReader reader = new BufferedReader ( new InputStreamReader ( in , UTF_8 ) ) ; for ( String line = reader . readLine ( ) ; line != null ; line = reader . readLine ( ) ) { builder . add ( line ) ; } } } return builder . build ( ) ; } catch ( IOException iox ) { throw new RuntimeException ( "Unable to read deltemplate listing" , iox ) ; } }
Walks all resources with the META_INF_DELTEMPLATE_PATH and collects the deltemplates .