launcher/src/wombat/launcher/Wombat.java
private static void installThese(List<Version> toInstall) throws MalformedURLException, IOException {
		buildUpdateFrame();
		UpdateFrame.setVisible(true);
		
		// Update the files.
		OverallProgress.setMaximum(toInstall.size());
		int i = 0;
		final int maxi = toInstall.size();
		for (Version v : toInstall) {
			final int updatei = i;
			SwingUtilities.invokeLater(new Runnable() {
				public void run() {
					OverallProgress.setString(updatei + "/" + maxi);
					OverallProgress.setValue(updatei);
				}
			});
			i++;
			
			// Grab the file (this will update the progress bars as well)
			download(v.Name, new URL(UpdateSite + v.Filename), new File(CurrentDir, v.Filename));
			
			// Update that file's version.
			boolean hadOldVersion = false;
			for (Version oldV : Versions) {
				if (v.Name.equals(oldV.Name)
					&& ((v.OS == null && oldV.OS == null)
							|| (v.OS != null && v.OS.equals(oldV.OS)))) {
					
					hadOldVersion = true;
					oldV.Filename = v.Filename;
					oldV.OS = v.OS;
					oldV.VersionString = v.VersionString;
					oldV.Version.clear();
					oldV.Version.addAll(v.Version);
					break;
					
				}
			}
			if (!hadOldVersion)
				Versions.add(v);
		}
		
		// Update the local version file.
		StringBuilder sb = new StringBuilder();
		for (Version v : Versions) {
			sb.append(v.toString());
			sb.append("\n");
		}
		PrintWriter pw = new PrintWriter(VersionFile);
		pw.write(sb.toString());
		pw.close();
		
		UpdateFrame.setVisible(false);
	}
/**
	 * Install just these missing files.
	 * @param toInstall The versions to install.
	 * @throws IOException If a file couldn't be downloaded.
	 * @throws MalformedURLException If any of the file URLs are bad.
	 */
Install just these missing files.
@param toInstall The versions to install.
@throws IOException If a file couldn't be downloaded.
@throws MalformedURLException If any of the file URLs are bad.
Install just these missing files . @param toInstall The versions to install . @throws IOException If a file couldn ' t be downloaded . @throws MalformedURLException If any of the file URLs are bad .
private static void installThese(List<Version> toInstall) throws MalformedURLException, IOException {
		buildUpdateFrame();
		UpdateFrame.setVisible(true);
		OverallProgress.setMaximum(toInstall.size());
		int i = 0;
		final int maxi = toInstall.size();
		for (Version v : toInstall) {
			final int updatei = i;
			SwingUtilities.invokeLater(new Runnable() {
				public void run() {
					OverallProgress.setString(updatei + "/" + maxi);
					OverallProgress.setValue(updatei);
				}
			});
			i++;
			download(v.Name, new URL(UpdateSite + v.Filename), new File(CurrentDir, v.Filename));
			boolean hadOldVersion = false;
			for (Version oldV : Versions) {
				if (v.Name.equals(oldV.Name)
					&& ((v.OS == null && oldV.OS == null)
							|| (v.OS != null && v.OS.equals(oldV.OS)))) {
					hadOldVersion = true;
					oldV.Filename = v.Filename;
					oldV.OS = v.OS;
					oldV.VersionString = v.VersionString;
					oldV.Version.clear();
					oldV.Version.addAll(v.Version);
					break;
				}
			}
			if (!hadOldVersion)
				Versions.add(v);
		}
		StringBuilder sb = new StringBuilder();
		for (Version v : Versions) {
			sb.append(v.toString());
			sb.append("\n");
		}
		PrintWriter pw = new PrintWriter(VersionFile);
		pw.write(sb.toString());
		pw.close();
		UpdateFrame.setVisible(false);
	}
private static void installThese ( List < Version > toInstall ) throws MalformedURLException , IOException { buildUpdateFrame ( ) ; UpdateFrame . setVisible ( true ) ; OverallProgress . setMaximum ( toInstall . size ( ) ) ; int i = 0 ; final int maxi = toInstall . size ( ) ; for ( Version v : toInstall ) { final int updatei = i ; SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { OverallProgress . setString ( updatei + "/" + maxi ) ; OverallProgress . setValue ( updatei ) ; } } ) ; i ++ ; download ( v . Name , new URL ( UpdateSite + v . Filename ) , new File ( CurrentDir , v . Filename ) ) ; boolean hadOldVersion = false ; for ( Version oldV : Versions ) { if ( v . Name . equals ( oldV . Name ) && ( ( v . OS == null && oldV . OS == null ) || ( v . OS != null && v . OS . equals ( oldV . OS ) ) ) ) { hadOldVersion = true ; oldV . Filename = v . Filename ; oldV . OS = v . OS ; oldV . VersionString = v . VersionString ; oldV . Version . clear ( ) ; oldV . Version . addAll ( v . Version ) ; break ; } } if ( ! hadOldVersion ) Versions . add ( v ) ; } StringBuilder sb = new StringBuilder ( ) ; for ( Version v : Versions ) { sb . append ( v . toString ( ) ) ; sb . append ( "\n" ) ; } PrintWriter pw = new PrintWriter ( VersionFile ) ; pw . write ( sb . toString ( ) ) ; pw . close ( ) ; UpdateFrame . setVisible ( false ) ; }
Install just these missing files.
Install just these missing files .
// Update the files. // Grab the file (this will update the progress bars as well) // Update that file's version. // Update the local version file.