The following modifications are targeted to improve the output displayed by the Java WebStart Setup. There were two issues with the existing code:
1. We used to pass the parameter 'overallPercent' of the validating method of WebStartDownloader to calculate the downloaded percentage. This is wrong as this value corresponds to the validation percentage. This produced to sometimes display a downloaded 0 % while we were validating the files.
2. We did not provide any additional feedback while we were validating a jar file. This produced the displayed message to be stuck at 'Downloading: 33 % Completed' or 'Downloading: 66 % Completed'.
The fix for the first issue is trivial: the value indicating the percentage of downloaded files is not modified in the validating method nor in the upgradingArchive method of the WebStartDownloader class.
The fix for the second issue consists of adding some interfaces to WebStartDownloader to know whether we are downloading a jar file, validating a jar file or upgrading a jar file. In addition to that two methods have been added to know how much of the current jar file has been validated or upgraded. This way we can have know a more complete (and lively) message during download. When we are just downloading a jar file the message will stay the same. For example:
'Downloading: 23 % Completed'
But when we are validating a jar file the message will be:
'Downloading: 33% Completed - Validating file: 89 % Completed.