/** * Retrieves the manifest information for the jar file which contains this utility class. * * @return The Manifest file for the jar file which contains this utility class, or <code>null</code> if the code * is not in a jar file. */ public static Manifest getManifest() { return ManifestUtil.getManifest( ManifestUtil.class ); }
public static VersionInfo getVersionInfo( final Class clazz ) { // Check if server-assembly.properties exists ResourceBundle assemblyBundle = null; try { assemblyBundle = ResourceBundle.getBundle("server-assembly"); } catch (MissingResourceException ignored) { } if (assemblyBundle != null) { return VersionHelper.getVersionInfoFromProperties(assemblyBundle); } // Try to get the manifest for the class final Manifest manifest = ManifestUtil.getManifest( clazz ); if ( manifest != null ) { // Return the version info from the manifest return VersionHelper.createVersionInfo( manifest ); } // Return the default version info (from properties file) return VersionHelper.createVersionInfo(); }