public class VersionChecker extends java.lang.Object implements KnockOffListener
If a newer one is available the new jar can be downloaded and saved in a way that the old jar is replaced. Possibly the program can also be restarted using the new jar.
| Modifier and Type | Class and Description |
|---|---|
static interface |
VersionChecker.ProgramAccess
Program information necessary for automatic update.
|
static class |
VersionChecker.Version
Helper class for a simple version build from
numbers separated by points.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG_COMMENT |
static java.lang.String |
TAG_MINJVM |
static java.lang.String |
TAG_NOUPDATE |
static java.lang.String |
TAG_SEPARATOR |
static java.lang.String |
TAG_VERSION |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkForNewVersion(VersionChecker.ProgramAccess pa)
Check whether a new version is available.
|
void |
knockedOff(Worker worker)
Invoked when the worker has finished.
|
static boolean |
writeStreamToFile(java.io.InputStream is,
java.io.File target)
Write the complete content of a stream to a file.
|
public static final java.lang.String TAG_SEPARATOR
public static final java.lang.String TAG_COMMENT
public static final java.lang.String TAG_VERSION
public static final java.lang.String TAG_MINJVM
public static final java.lang.String TAG_NOUPDATE
public void knockedOff(@NotNull Worker worker)
knockedOff in interface KnockOffListenerworker - worker which finishedpublic static boolean writeStreamToFile(@NotNull java.io.InputStream is, @NotNull java.io.File target) throws java.io.IOException
is - input streamtarget - targettrue if anything was writtenfalse: if nothing was writtenjava.io.IOException - on read and write errorspublic static void checkForNewVersion(@NotNull VersionChecker.ProgramAccess pa)
pa - access to already running program