use of com.compomics.software.autoupdater.MavenJarFile in project peptide-shaker by compomics.
the class PeptideShakerGUI method checkForNewVersion.
/**
* Check for new version.
*
* @return true if a new version is to be downloaded
*/
public boolean checkForNewVersion() {
try {
File jarFile = new File(PeptideShakerGUI.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
MavenJarFile oldMavenJarFile = new MavenJarFile(jarFile.toURI());
URL jarRepository = new URL("http", "genesis.ugent.be", "/maven2/");
return CompomicsWrapper.checkForNewDeployedVersion("PeptideShaker", oldMavenJarFile, jarRepository, "peptide-shaker.ico", false, true, true, Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")), Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")), true);
} catch (UnknownHostException ex) {
// no internet connection
System.out.println("Checking for new version failed. No internet connection.");
return false;
} catch (ConnectException ex) {
// connection refused
System.out.println("Checking for new version failed. Connection refused.");
return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
use of com.compomics.software.autoupdater.MavenJarFile in project peptide-shaker by compomics.
the class WelcomeDialog method checkForNewSearchGUIVersion.
/**
* Check for new version.
*
* @param searchGuiJarPath the path to the SearchGUI jar file
* @return true if a new version is available
*/
public boolean checkForNewSearchGUIVersion(String searchGuiJarPath) {
try {
File jarFile = new File(searchGuiJarPath);
MavenJarFile oldMavenJarFile = new MavenJarFile(jarFile.toURI());
URL jarRepository = new URL("http", "genesis.ugent.be", "/maven2/");
return WebDAO.newVersionReleased(oldMavenJarFile, jarRepository);
} catch (UnknownHostException ex) {
System.out.println("Checking for new version failed. No internet connection.");
// no internet connection
return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
Aggregations