public static class ApplicationUpdater.Updater extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected ApplicationUpdater.ApplicationUpdaterCallback |
callback |
protected ApplicationConfig |
config |
protected File |
currentDir |
protected File |
destDir |
protected String |
vfsPropertiesUrl |
| Constructor and Description |
|---|
ApplicationUpdater.Updater(ApplicationConfig config,
String vfsPropertiesUrl,
File currentDir,
File destDir,
ApplicationUpdater.ApplicationUpdaterCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deepCopy(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
String srcPath,
String targetPath)
Recupere le contenu du repertoire de l'archive pour le mettre dans targetPath
si targetPath existait deja, il est supprime au prealable.
|
protected void |
doUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
ApplicationUpdater.ApplicationInfo info)
Decompresse le zip qui est pointer par l'url dans le repertoire
specifie, et ajoute le fichier contenant la version de l'application.
|
protected List<String> |
getApplicationName(ApplicationConfig config)
Retourne la liste des noms d'application se trouvant dans la
configuration
|
protected Map<String,String> |
getCurrentVersion(List<String> apps,
File dir)
Recherche pour chaque application la version courante
|
protected ApplicationConfig |
getUpdaterConfig(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
String vfsPropertiesUrl)
Return config prepared for os and arch
|
protected org.apache.commons.vfs2.FileSystemOptions |
getVFSConfig(ApplicationConfig config)
Recupere le proxy http a utiliser pour les connexions reseaux
|
void |
run()
Recupere le fichier properties contenant les informations de mise a jour
liste les applications et leur version actuelle
pour chaque application a mettre a jour recupere le zip et le decompresse
Si callback existe envoi les messages necessaire
|
protected String |
toVfsURL(String path)
Converti le path en URL vfs2.
|
protected ApplicationConfig config
protected String vfsPropertiesUrl
protected File currentDir
protected File destDir
protected ApplicationUpdater.ApplicationUpdaterCallback callback
public ApplicationUpdater.Updater(ApplicationConfig config, String vfsPropertiesUrl, File currentDir, File destDir, ApplicationUpdater.ApplicationUpdaterCallback callback)
public void run()
protected void doUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
ApplicationUpdater.ApplicationInfo info)
throws Exception
proxy - le proxy a utiliser pour la connexion a l'urlinfo - information sur l'application a mettre a jourExceptionprotected void deepCopy(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
String srcPath,
String targetPath)
throws org.apache.commons.vfs2.FileSystemException
srcPath - source path de la forme vfs2 ex:"zip:http://www.nuiton.org/attachments/download/830/nuiton-utils-2.6.5-deps.zip"targetPath - le path destinationorg.apache.commons.vfs2.FileSystemExceptionprotected String toVfsURL(String path)
path - protected ApplicationConfig getUpdaterConfig(org.apache.commons.vfs2.FileSystemOptions vfsConfig, String vfsPropertiesUrl) throws Exception
Exceptionprotected org.apache.commons.vfs2.FileSystemOptions getVFSConfig(ApplicationConfig config)
config - protected Map<String,String> getCurrentVersion(List<String> apps, File dir)
apps - la liste des applications a rechercherprotected List<String> getApplicationName(ApplicationConfig config)
config - Copyright © 2004-2013 CodeLutin. All Rights Reserved.