Gridarta Editor
net.sf.gridarta.updater.Updater Class Reference
+ Inheritance diagram for net.sf.gridarta.updater.Updater:
+ Collaboration diagram for net.sf.gridarta.updater.Updater:

Classes

class  VersionInfo
 

Public Member Functions

void run ()
 
 Updater (@Nullable final Component parentComponent, @NotNull final Exiter exiter, @NotNull final String updateFileName)
 

Static Public Attributes

static final String LAST_UPDATE_KEY = "UpdateTimestamp"
 

Private Member Functions

boolean askIfUserWantsUpdate (@Nullable final VersionInfo active, @NotNull final VersionInfo update, @NotNull final String propUrl, @NotNull final String downloadUrl)
 
void downloadAndInstallUpdate (@NotNull final String url)
 
void noNewUpdate (@Nullable final VersionInfo active, @NotNull final VersionInfo update, @NotNull final String propUrl, @NotNull final String downloadUrl)
 
InputStream openStream (@NotNull final String url) throws IOException
 

Private Attributes

final Exiter exiter
 
final Component parentComponent
 
final String updateFileName
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 
static final int BUF_SIZE = 4096
 
static final Category LOG = Logger.getLogger(Updater.class)
 
static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
 

Detailed Description

This class handles updating the map editor.

Author
Christian.Hujer @fixme the updater fails on windows, the user is notified of this but still it isn't nice. The updater should be a separate application.
Todo:
move the updater to JAPI

Definition at line 58 of file Updater.java.

Constructor & Destructor Documentation

◆ Updater()

net.sf.gridarta.updater.Updater.Updater ( @Nullable final Component  parentComponent,
@NotNull final Exiter  exiter,
@NotNull final String  updateFileName 
)

Creates a new instance.

Parameters
parentComponentthe parent component to show dialogs on
exiterthe exiter for terminating the application
updateFileNamethe file to update

Definition at line 113 of file Updater.java.

References net.sf.gridarta.updater.Updater.exiter, net.sf.gridarta.updater.Updater.parentComponent, and net.sf.gridarta.updater.Updater.updateFileName.

Member Function Documentation

◆ askIfUserWantsUpdate()

boolean net.sf.gridarta.updater.Updater.askIfUserWantsUpdate ( @Nullable final VersionInfo  active,
@NotNull final VersionInfo  update,
@NotNull final String  propUrl,
@NotNull final String  downloadUrl 
)
private

Asks the user whether he wants to update.

Parameters
activethe version info of the currently installed version
updatethe version info of the available update version
propUrlthe URL where properties were downloaded from
downloadUrlthe URL where the update would be downloaded from
Returns
true
if the user chose that he wants to update, otherwise
false

Definition at line 173 of file Updater.java.

References net.sf.gridarta.updater.Updater.ACTION_BUILDER, net.sf.gridarta.updater.Updater.parentComponent, and net.sf.gridarta.updater.Updater.updateFileName.

Referenced by net.sf.gridarta.updater.Updater.run().

+ Here is the caller graph for this function:

◆ downloadAndInstallUpdate()

void net.sf.gridarta.updater.Updater.downloadAndInstallUpdate ( @NotNull final String  url)
private

◆ noNewUpdate()

void net.sf.gridarta.updater.Updater.noNewUpdate ( @Nullable final VersionInfo  active,
@NotNull final VersionInfo  update,
@NotNull final String  propUrl,
@NotNull final String  downloadUrl 
)
private

Tells the user there is no update.

Parameters
activethe version info of the currently installed version
updatethe version info of the available update version
propUrlthe URL where properties were downloaded from
downloadUrlthe URL where the update would be downloaded from

Definition at line 184 of file Updater.java.

References net.sf.gridarta.updater.Updater.ACTION_BUILDER, and net.sf.gridarta.updater.Updater.parentComponent.

Referenced by net.sf.gridarta.updater.Updater.run().

+ Here is the caller graph for this function:

◆ openStream()

InputStream net.sf.gridarta.updater.Updater.openStream ( @NotNull final String  url) throws IOException
private

Opens an input stream on an URL.

Parameters
urlthe URL to the open input stream on
Returns
the input stream for the URL
Exceptions
IOExceptionin case of I/O problems

Definition at line 237 of file Updater.java.

References net.sf.gridarta.updater.Updater.ACTION_BUILDER, net.sf.gridarta.gui.dialog.prefs.NetPreferences.getProxy(), net.sf.gridarta.utils.ActionBuilderUtils.getString(), and net.sf.gridarta.updater.Updater.parentComponent.

Referenced by net.sf.gridarta.updater.Updater.downloadAndInstallUpdate(), and net.sf.gridarta.updater.Updater.run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.updater.Updater.ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
staticprivate

◆ BUF_SIZE

final int net.sf.gridarta.updater.Updater.BUF_SIZE = 4096
staticprivate

The buffer size in bytes.

Definition at line 105 of file Updater.java.

Referenced by net.sf.gridarta.updater.Updater.downloadAndInstallUpdate().

◆ exiter

final Exiter net.sf.gridarta.updater.Updater.exiter
private

The Exiter for terminating the application.

Definition at line 94 of file Updater.java.

Referenced by net.sf.gridarta.updater.Updater.downloadAndInstallUpdate(), and net.sf.gridarta.updater.Updater.Updater().

◆ LAST_UPDATE_KEY

final String net.sf.gridarta.updater.Updater.LAST_UPDATE_KEY = "UpdateTimestamp"
static

The preferences key for last update.

Definition at line 82 of file Updater.java.

Referenced by net.sf.gridarta.updater.Updater.run(), and net.sf.gridarta.updater.UpdaterManager.startup().

◆ LOG

final Category net.sf.gridarta.updater.Updater.LOG = Logger.getLogger(Updater.class)
staticprivate

The logger.

Definition at line 70 of file Updater.java.

Referenced by net.sf.gridarta.updater.Updater.downloadAndInstallUpdate().

◆ parentComponent

◆ PREFERENCES

final Preferences net.sf.gridarta.updater.Updater.PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
staticprivate

The preferences.

Definition at line 76 of file Updater.java.

Referenced by net.sf.gridarta.updater.Updater.run().

◆ updateFileName

final String net.sf.gridarta.updater.Updater.updateFileName
private

The documentation for this class was generated from the following file: