public class Updater
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log
Used for logging.
|
static java.lang.String |
UPDATE_DIRECTORY
The name of the directory to download updates to.
|
static java.lang.String |
UPDATE_FILE
The default name of the update file.
|
Constructor and Description |
---|
Updater()
Launches the updater with the given updater file.
|
Modifier and Type | Method and Description |
---|---|
static java.awt.Point |
getCenteredPoint(java.awt.Component component)
This method returns the point a component, like a dialog, should be placed on the screen
based on the components length and width so that it is centerd.
|
static java.util.Properties |
getProperties()
Returns a reference to the
Properties object. |
void |
handleLocalUpdate()
Performs an update that would have been invoked via a local file instead
of updating against the remote server.
|
static void |
launchUpdater(java.io.File updateFile,
java.lang.String workingDir,
java.lang.String versionNumber)
Launches the updater using the given settings.
|
static void |
load()
Loads the settings.
|
static void |
main(java.lang.String[] args)
Launches the app.
|
static void |
save()
Saves the settings.
|
void |
update(java.io.File updateFile,
java.lang.String workingDir,
java.lang.String versionNumber,
boolean isStandAlone)
Handles the update.
|
public static org.apache.log4j.Logger log
public static final java.lang.String UPDATE_DIRECTORY
public static final java.lang.String UPDATE_FILE
public void update(@NotNull java.io.File updateFile, @NotNull java.lang.String workingDir, java.lang.String versionNumber, boolean isStandAlone)
updateFile
- The zip file containing the updated
files.workingDir
- Where screen-scraper is installed.versionNumber
- The new version number.isStandAlone
- Indicates whether or not the updater is running in
standalone mode.public static void launchUpdater(@NotNull java.io.File updateFile, java.lang.String workingDir, java.lang.String versionNumber)
updateFile
- The zip file containing the updated
files.workingDir
- Where screen-scraper is installed.versionNumber
- The new version number.public static void load()
public static void save()
@Nullable public static java.util.Properties getProperties()
Properties
object.Properties
object.public static java.awt.Point getCenteredPoint(@NotNull java.awt.Component component)
component
- Component to find the centerd location for.public void handleLocalUpdate()
public static void main(java.lang.String[] args)
args
- The command line arguments