Package com.newrelic.agent.bridge
Class ManifestUtils
- java.lang.Object
-
- com.newrelic.agent.bridge.ManifestUtils
-
public class ManifestUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ManifestUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetVersionFromManifest(java.lang.Class<?> clazz, java.lang.String jarName, java.lang.String defaultVersion)Attempt to figure out the version of a given library/jar from its MANIFEST.MF file.static java.lang.StringgetVersionFromManifest(java.util.jar.Manifest manifest)
-
-
-
Method Detail
-
getVersionFromManifest
public static java.lang.String getVersionFromManifest(java.lang.Class<?> clazz, java.lang.String jarName, java.lang.String defaultVersion)Attempt to figure out the version of a given library/jar from its MANIFEST.MF file. If nothing can be found, use the default value provided as a fallback. This first attempts to get the manifest file via a "fast path" using the jar of the provided class file. If that fails, we scan all manifests for the correct one based on the expected jar name.- Parameters:
clazz- a class to get the jar forjarName- the name of the jar file to do a "contains" match ondefaultVersion- a default value to return if nothing is found in the manifest- Returns:
- the version of the library based on the MANIFEST.MF file
-
getVersionFromManifest
public static java.lang.String getVersionFromManifest(java.util.jar.Manifest manifest)
-
-