public final class BridgeVersion extends Object
| Modifier and Type | Field and Description |
|---|---|
static String | HEADERThe HTTP header the extension adds to router requests to self-report. |
| Modifier and Type | Method and Description |
|---|---|
static int | compare(String a,
String b)Compares two dotted version strings numerically by segment; missing or
non-numeric segments count as 0. |
(package private) static String | extractVersion(String json)Extracts the "version" string from extension manifest JSON without a JSON
parser, by locating the version key and reading the quoted value after it. |
static boolean | isUpdateAvailable(String installed,
String bundled)Whether an update to the bundled version is available for the installed one. |
static String | readXpiVersion(InputStream xpi)Reads the "version" field from the manifest.json inside a zipped XPI. |
public static final String HEADER
public static int compare(String a, String b)
a - first version, may be nullb - second version, may be nullstatic String extractVersion(String json)
json - the manifest contentpublic static boolean isUpdateAvailable(String installed, String bundled)
installed - the version reported by the extension, may be nullbundled - the version bundled in this war, may be nullpublic static String readXpiVersion(InputStream xpi)
xpi - the open XPI stream; closed by this method. May be null.