public static void validateManifest ( String manifestName , Manifest manifest ) throws ConfigException { Attributes attr = manifest . getMainAttributes ( ) ; if ( attr == null ) return ; String extList = attr . getValue ( "Extension-List" ) ; if ( extList == null ) return ; Pattern pattern = Pattern . compile ( "[, \t]+" ) ; String [ ] split = pattern . split ( extList ) ; for ( int i = 0 ; i < split . length ; i ++ ) { String ext = split [ i ] ; String name = attr . getValue ( ext + "-Extension-Name" ) ; if ( name == null ) continue ; Package pkg = Package . getPackage ( name ) ; if ( pkg == null ) { log . warning ( L . l ( "package {0} is missing. {1} requires package {0}." , name , manifestName ) ) ; continue ; } String version = attr . getValue ( ext + "-Specification-Version" ) ; if ( version == null ) continue ; if ( pkg . getSpecificationVersion ( ) == null || pkg . getSpecificationVersion ( ) . equals ( "" ) ) { log . warning ( L . l ( "installed {0} is not compatible with version `{1}'. {2} requires version {1}." , name , version , manifestName ) ) ; } else if ( ! pkg . isCompatibleWith ( version ) ) { log . warning ( L . l ( "installed {0} is not compatible with version `{1}'. {2} requires version {1}." , name , version , manifestName ) ) ; } } }
Validates the manifest .