Performs an update to the iDynomics tool if a new version has been detected. More...
Public Member Functions | |
Update_IDynomics () | |
Constructor to launch the procedure of an iDynomics update. More... | |
void | copy (String srFile, String dtFile) throws FileNotFoundException, IOException |
Replaces old version of a file with the updated version from the repository. More... | |
Static Public Member Functions | |
static void | main (String args[]) |
Main method - called to begin the process of updating iDynomics. More... | |
Public Attributes | |
String | pathToURLhtml = "http://www.biosciences-labs.bham.ac.uk/kreftlab/iDynomics/updater_check/url.html" |
Performs an update to the iDynomics tool if a new version has been detected.
This class should be thought of as a standalone class. It may be packaged within iDynomics, and called by iDynomics, but is run independently as its own jar file. The purpose of this is to download the latest version from the web repository, extract the files, update the currently downloaded version to the new version, and then delete files used in the update. As this is changing class files, one of which could be the main simulator, the simulation should be shut down when this is done. Therefore, iDynomics calls this jar and exits - the update can be performed, and the user should then restart iDynomics.
This code has been amended from a freely available example update procedure written by Thomas Otero, documented here: http://www.dreamincode.net/forums/topic/190944-creating-an-updater-in-java/
soft_update.Update_IDynomics.Update_IDynomics | ( | ) |
Constructor to launch the procedure of an iDynomics update.
This constructor begins the update procedure by calling the methods to create a status window that specifies update progress, and the methods to perform the download of the update and copying of the relevant files
void soft_update.Update_IDynomics.copy | ( | String | srFile, |
String | dtFile | ||
) | throws FileNotFoundException, IOException |
Replaces old version of a file with the updated version from the repository.
This method replaces an old version of a simulation file with an up to date version
srFile | Path to the new updated file |
dtFile | Path to the file to be replaced |
FileNotFoundException | Exception should this file not be found |
IOException | Exception should there be an input/output error during copying |
|
static |
Main method - called to begin the process of updating iDynomics.
This method is launched by the simulator when the user chooses to update iDynomics. The relevant download, unzip, and copy methods are then run as required.
args | Program arguments - though none are required in this case |
String soft_update.Update_IDynomics.pathToURLhtml = "http://www.biosciences-labs.bham.ac.uk/kreftlab/iDynomics/updater_check/url.html" |
Path to the web address where url.html can be found - this file contains the web address of the update package