Package org.omegat.util
Class VersionChecker
- java.lang.Object
-
- org.omegat.util.VersionChecker
-
public final class VersionChecker extends java.lang.Object
A class for checking for updated versions of OmegaT.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
compareVersions(java.lang.String version1, java.lang.String update1, java.lang.String version2, java.lang.String update2)
Compares OmegaT version numbers.static VersionChecker
getInstance()
java.lang.String
getRemoteVersion()
boolean
isUpToDate(boolean force)
Check if OmegaT is up to date.
-
-
-
Method Detail
-
getInstance
public static VersionChecker getInstance()
-
isUpToDate
public boolean isUpToDate(boolean force) throws java.lang.Exception
Check if OmegaT is up to date.- Parameters:
force
- If true, fetch the latest data from the server even if the current data is not stale yet- Throws:
java.lang.Exception
-
getRemoteVersion
public java.lang.String getRemoteVersion() throws java.lang.Exception
- Throws:
java.lang.Exception
-
compareVersions
public static int compareVersions(java.lang.String version1, java.lang.String update1, java.lang.String version2, java.lang.String update2)
Compares OmegaT version numbers.- Parameters:
version1
- e.g. "5.4.0"update1
- e.g. "0"version2
- e.g. "3.0.6"update2
- "1"- Returns:
- the value 0 if version1 update1 == version2 update2; a value less than 0 if version1 update1 < version2 update2; and a value greater than 0 if version1 update1 > version2 update2
-
-