Class WebDAO
java.lang.Object
com.compomics.software.autoupdater.WebDAO
public class WebDAO extends Object
WebDAO.
- Author:
- Davy Maddelein
-
Constructor Summary
Constructors Constructor Description WebDAO()
-
Method Summary
Modifier and Type Method Description static String
getLatestVersionNumberFromRemoteRepo(URL remoteVersionXMLFileLocation)
Fetches the latest Maven deployed version from a Maven built repository.static URL
getUrlOfZippedVersion(URL repoURL, String suffix, boolean returnAlternateArchives)
Gets the first zip file from a URL, in case of a Maven repo deploy this should be the only zip in the folder.static boolean
newVersionReleased(MavenJarFile jarFile, URL jarRepository)
Returns true if a new version is available.
-
Constructor Details
-
WebDAO
public WebDAO()
-
-
Method Details
-
getLatestVersionNumberFromRemoteRepo
public static String getLatestVersionNumberFromRemoteRepo(URL remoteVersionXMLFileLocation) throws XMLStreamException, IOExceptionFetches the latest Maven deployed version from a Maven built repository.- Parameters:
remoteVersionXMLFileLocation
- the version of the remote XML file- Returns:
- the latest Maven deployed version
- Throws:
XMLStreamException
- if an XMLStreamException occursIOException
- if an IOException occurs
-
getUrlOfZippedVersion
public static URL getUrlOfZippedVersion(URL repoURL, String suffix, boolean returnAlternateArchives) throws MalformedURLException, IOExceptionGets the first zip file from a URL, in case of a Maven repo deploy this should be the only zip in the folder.- Parameters:
repoURL
- the URL to get the zip fromsuffix
- what file extension should be looked forreturnAlternateArchives
- if the requested file extension isn't found, return the first .zip/tar.gz found- Returns:
- URL to the archive file
- Throws:
MalformedURLException
- if the URL of the zip could not be foundIOException
- if the stream to the web page could not be read
-
newVersionReleased
public static boolean newVersionReleased(MavenJarFile jarFile, URL jarRepository) throws IOException, XMLStreamExceptionReturns true if a new version is available.- Parameters:
jarFile
- the Maven jar filejarRepository
- the repository- Returns:
- true if a new version is available
- Throws:
IOException
- if an IOException occursXMLStreamException
- if an XMLStreamException occurs
-