Class DownloadLatestZipFromRepo

java.lang.Object
com.compomics.software.autoupdater.DownloadLatestZipFromRepo

public class DownloadLatestZipFromRepo
extends Object
Download the latest zip file from the repository.
Author:
Davy Maddelein, Harald Barsnes
  • Constructor Details

  • Method Details

    • downloadLatestZipFromRepo

      public static void downloadLatestZipFromRepo​(URL jarPath, String toolName) throws IOException, XMLStreamException, URISyntaxException
      Downloads the latest deploy from the genesis Maven repository of the artifact of the jarPath, starts it without arguments and removes the old jar if there was an update.
      Parameters:
      jarPath - the path to the jarfile
      toolName - the name of the tool being updated, e.g., PeptideShaker
      Throws:
      IOException - should there be problems with reading or writing files during the updating
      XMLStreamException - if there was a problem reading the meta data from the remote Maven repository
      URISyntaxException - if there is a problem with the URI syntax
    • downloadLatestZipFromRepo

      public static void downloadLatestZipFromRepo​(URL jarPath, String toolName, boolean deleteOldFiles, boolean startDownloadedVersion, boolean addDesktopIcon, WaitingHandler waitingHandler) throws IOException, XMLStreamException, URISyntaxException
      Downloads the latest deploy from the genesis Maven repository of the artifact and starts it without arguments.
      Parameters:
      jarPath - the path to the jarfile
      toolName - the name of the tool being updated, e.g., PeptideShaker
      deleteOldFiles - if the jar who starts the update should be deleted
      startDownloadedVersion - if the newly downloaded jar should be started after download
      addDesktopIcon - if true, a desktop icon will be created
      waitingHandler - the waiting handler
      Throws:
      IOException - should there be problems with reading or writing files during the updating
      XMLStreamException - if there was a problem reading the meta data from the remote Maven repository
      URISyntaxException - if there is a problem with the URI syntax
    • downloadLatestZipFromRepo

      public static void downloadLatestZipFromRepo​(URL jarPath, String toolName, boolean deleteOldFiles, String[] args, boolean startDownloadedVersion, boolean addDesktopIcon, WaitingHandler waitingHandler) throws IOException, XMLStreamException, URISyntaxException
      Downloads the latest zip archive of the jar in the URL from the genesis Maven repository.
      Parameters:
      jarPath - the path to the jarfile to update
      toolName - the name of the tool being updated, e.g., PeptideShaker
      deleteOldFiles - if the original jar file should be deleted
      args - the arguments for the newly downloaded jar when it starts
      startDownloadedVersion - if true, the downloaded version will be started when the download completes
      addDesktopIcon - if true, a desktop icon will be created
      waitingHandler - the waiting handler
      Throws:
      IOException - should there be problems with reading or writing files during the updating
      XMLStreamException - if there was a problem reading the meta data from the remote Maven repository
      URISyntaxException - if there is a problem with the URI syntax
    • downloadLatestZipFromRepo

      public static void downloadLatestZipFromRepo​(URL jarPath, String toolName, boolean deleteOldFiles, boolean addDesktopIcon, String[] args, URL jarRepository, WaitingHandler waitingHandler) throws IOException, XMLStreamException, URISyntaxException
      Downloads the latest zip archive of the jar in the URL from a given jarRepository.
      Parameters:
      jarPath - the path to the jarfile to update, cannot be null
      toolName - the name of the tool being updated, e.g., PeptideShaker
      deleteOldFiles - if the original jar folder should be deleted, cannot be null
      addDesktopIcon - if true, a desktop icon will be created
      args - the arguments for the newly downloaded jar when it starts
      jarRepository - the repository to look for the latest deploy of the jar file, cannot be null
      waitingHandler - the waiting handler
      Throws:
      IOException - should there be problems with reading or writing files during the updating
      XMLStreamException - if there was a problem reading the meta data from the remote Maven repository
      URISyntaxException - if there is a problem with the URI syntax
    • downloadLatestZipFromRepo

      public static void downloadLatestZipFromRepo​(URL jarPath, String toolName, boolean deleteOldFiles, String iconName, String[] args, URL jarRepository, boolean startDownloadedVersion, boolean addDesktopIcon, WaitingHandler waitingHandler) throws IOException, XMLStreamException, URISyntaxException
      Retrieves the latest version of a Maven jar file from a Maven repository, also checks if the environment is headless or not.
      Parameters:
      jarPath - the URL of the location of the jar that needs to be updated on the file system. cannot be null
      toolName - the name of the tool being updated, e.g., PeptideShaker
      deleteOldFiles - should the old installation be removed or not cannot be null
      iconName - name of the shortcut image should one be created
      args - the arguments that will be passed to the newly downloaded program when started, cannot be null
      jarRepository - the Maven repository to go look in, cannot be null
      startDownloadedVersion - if the newly downloaded version should be started automatically or not
      addDesktopIcon - if true, a desktop icon will be created
      waitingHandler - the waiting handler
      Throws:
      IOException - should there be problems with reading or writing files during the updating
      XMLStreamException - if there was a problem reading the meta data from the remote Maven repository
      URISyntaxException - if there is a problem with the URI syntax
    • downloadLatestZipFromRepo

      public static void downloadLatestZipFromRepo​(URL jarPath, String toolName, boolean deleteOldFiles, String iconName, String[] args, URL jarRepository, boolean startDownloadedVersion, boolean addDesktopIcon, FileDAO fileDAO, WaitingHandler waitingHandler) throws IOException, XMLStreamException, URISyntaxException
      Retrieves the latest version of a Maven jar file from a Maven repository.
      Parameters:
      jarPath - the URL of the location of the jar that needs to be updated on the file system. cannot be null
      toolName - the name of the tool being updated, e.g., PeptideShaker
      deleteOldFiles - should the old installation be removed or not cannot be null
      iconName - name of the shortcut image should one be created
      args - the arguments that will be passed to the newly downloaded program when started, cannot be null
      jarRepository - the Maven repository to go look in, cannot be null
      startDownloadedVersion - if the newly downloaded version should be started automatically or not
      addDesktopIcon - if true, a desktop icon will be created
      fileDAO - what implementation of FileDAO should be used in the updating
      waitingHandler - the waiting handler
      Throws:
      IOException - should there be problems with reading or writing files during the updating
      XMLStreamException - if there was a problem reading the meta data from the remote Maven repository
      URISyntaxException - if there is a problem with the URI syntax
    • downloadLatestZipFromRepo

      public static void downloadLatestZipFromRepo​(File downloadFolder, String toolName, String groupId, String artifactId, String iconName, String[] args, URL jarRepository, boolean startDownloadedVersion, boolean addDesktopIcon, FileDAO fileDAO, WaitingHandler waitingHandler) throws IOException, XMLStreamException, URISyntaxException
      Retrieves the latest version of a Maven jar file from a Maven repository.
      Parameters:
      downloadFolder - the folder to download to
      groupId - the group id
      toolName - the name of the tool being updated, e.g., PeptideShaker
      artifactId - the artifact id
      iconName - name of the shortcut image should one be created
      args - the arguments that will be passed to the newly downloaded program when started, cannot be null
      jarRepository - the Maven repository to go look in, cannot be null
      startDownloadedVersion - if the newly downloaded version should be started automatically or not
      addDesktopIcon - if true, a desktop icon will be created
      fileDAO - what implementation of FileDAO should be used in the updating
      waitingHandler - the waiting handler
      Throws:
      IOException - should there be problems with reading or writing files during the updating
      XMLStreamException - if there was a problem reading the meta data from the remote Maven repository
      URISyntaxException - if there is a problem with the URI syntax