public static String getVersion ( ) { String version = "unknown" ; final URLClassLoader cl = ( URLClassLoader ) cclass . getClassLoader ( ) ; try { final URL url = cl . findResource ( "META-INF/MANIFEST.MF" ) ; final Manifest manifest = new Manifest ( url . openStream ( ) ) ; for ( Entry < Object , Object > entry : manifest . getMainAttributes ( ) . entrySet ( ) ) { final Attributes . Name key = ( Attributes . Name ) entry . getKey ( ) ; if ( Attributes . Name . IMPLEMENTATION_VERSION . equals ( key ) ) { version = ( String ) entry . getValue ( ) ; } } } catch ( IOException e ) { logger . error ( "Unable to determine the product version due to error" , e ) ; } return version ; }
obtains the MQ Light version information from the manifest .