protected Map < String , IPackage > loadPackages ( Scriptable cfg ) throws URISyntaxException { Object obj = cfg . get ( PACKAGES_CONFIGPARAM , cfg ) ; Map < String , IPackage > packages = new HashMap < String , IPackage > ( ) ; if ( obj instanceof Scriptable ) { for ( Object id : ( ( Scriptable ) obj ) . getIds ( ) ) { if ( id instanceof Number ) { Number i = ( Number ) id ; Object pkg = ( ( Scriptable ) obj ) . get ( ( Integer ) i , ( Scriptable ) obj ) ; IPackage p = newPackage ( pkg ) ; if ( ! packages . containsKey ( p . getName ( ) ) ) { packages . put ( p . getName ( ) , p ) ; } } } } return packages ; }
Initializes and returns the map of packages based on the information in the server - side config JavaScript