public void initializeResources ( final String packageName ) throws ClassNotFoundException , IOException , URISyntaxException { final Map < Class < ? > , ImportResource [ ] > resourcesMap = ImportResourcesExtensions . getImportResources ( packageName ) ; for ( final Entry < Class < ? > , ImportResource [ ] > entry : resourcesMap . entrySet ( ) ) { final Class < ? > key = entry . getKey ( ) ; final ImportResource [ ] value = entry . getValue ( ) ; final Set < PackageResourceReferenceWrapper > packageResourceReferences = new LinkedHashSet <> ( ) ; for ( final ImportResource importResource : value ) { if ( importResource . resourceType ( ) . equalsIgnoreCase ( "js" ) ) { final PackageResourceReference t = new PackageResourceReference ( key , importResource . resourceName ( ) ) ; packageResourceReferences . add ( new PackageResourceReferenceWrapper ( t , ResourceReferenceType . JS ) ) ; } else if ( importResource . resourceType ( ) . equalsIgnoreCase ( "css" ) ) { final PackageResourceReference t = new PackageResourceReference ( key , importResource . resourceName ( ) ) ; packageResourceReferences . add ( new PackageResourceReferenceWrapper ( t , ResourceReferenceType . CSS ) ) ; } } PackageResourceReferences . getInstance ( ) . getPackageResourceReferenceMap ( ) . put ( key , packageResourceReferences ) ; } }
Initialize resources from the given package .