private Map < String , ProvisioningFeatureDefinition > getCoreProductFeatureDefinitions ( ) { Map < String , ProvisioningFeatureDefinition > features = new TreeMap < String , ProvisioningFeatureDefinition > ( ) ; File featureDir = getCoreFeatureDir ( ) ; //the feature directory may not exist if the packaged server had no features installed when minified if ( ! featureDir . isDirectory ( ) && ! featureDir . mkdir ( ) ) { throw new FeatureToolException ( "Unable to find or create feature directory: " + featureDir , MessageFormat . format ( NLS . messages . getString ( "tool.feature.dir.not.found" ) , featureDir ) , null , ReturnCode . MISSING_CONTENT ) ; } File platformDir = getCorePlatformDir ( ) ; File [ ] manifestFiles = featureDir . listFiles ( MFFilter ) ; if ( manifestFiles != null ) { for ( File file : manifestFiles ) { try { ProvisioningFeatureDefinition fd = new SubsystemFeatureDefinitionImpl ( ExtensionConstants . CORE_EXTENSION , file ) ; if ( fd . isSupportedFeatureVersion ( ) ) { // using symbolic name because gets compared to FeatureResource symbolic name features . put ( fd . getSymbolicName ( ) , fd ) ; } } catch ( IOException e ) { // TODO: PROPER NLS MESSAGE throw new FeatureToolException ( "Unable to read core feature manifest: " + file , ( String ) null , e , ReturnCode . BAD_FEATURE_DEFINITION ) ; } } } manifestFiles = platformDir . listFiles ( MFFilter ) ; if ( manifestFiles != null ) { for ( File file : manifestFiles ) { try { ProvisioningFeatureDefinition fd = new KernelFeatureListDefinition ( file ) ; // using symbolic name because gets compared to FeatureResource symbolic name features . put ( fd . getSymbolicName ( ) , fd ) ; } catch ( IOException e ) { // TODO: PROPER NLS MESSAGE throw new FeatureToolException ( "Unable to read core manifest: " + file , ( String ) null , e , ReturnCode . BAD_FEATURE_DEFINITION ) ; } } } return features ; }
Retrieves a Map of Liberty core features .