public static class ApplicationUpdater.Updater extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected ApplicationUpdaterCallback |
callback |
protected org.nuiton.util.config.ApplicationConfig |
config |
protected File |
currentDir |
protected File |
destDir |
protected DownloadMonitor |
downloadMonitor |
protected String |
vfsPropertiesUrl |
| Constructor and Description |
|---|
ApplicationUpdater.Updater(org.nuiton.util.config.ApplicationConfig config,
String vfsPropertiesUrl,
File currentDir,
File destDir,
DownloadMonitor downloadMonitor,
ApplicationUpdaterCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deepCopy(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
String srcPath,
String targetPath)
Deprecated.
since 2.6.11, no more used
|
protected void |
doUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
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 File |
downloadUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
ApplicationInfo info,
String srcPath)
Télécharge une archive dans un fichier temporaraire.
|
protected void |
explodeUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
ApplicationInfo info,
String archiveType,
File source,
File target)
Recopie le contenu du répertoire de l'archive dans le
répertoire
target. |
protected List<String> |
getApplicationName(org.nuiton.util.config.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 org.nuiton.util.config.ApplicationConfig |
getUpdaterConfig(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
String vfsPropertiesUrl)
Return config prepared for os and arch
|
protected org.apache.commons.vfs2.FileSystemOptions |
getVFSConfig(org.nuiton.util.config.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 org.nuiton.util.config.ApplicationConfig config
protected String vfsPropertiesUrl
protected File currentDir
protected File destDir
protected ApplicationUpdaterCallback callback
protected DownloadMonitor downloadMonitor
public ApplicationUpdater.Updater(org.nuiton.util.config.ApplicationConfig config,
String vfsPropertiesUrl,
File currentDir,
File destDir,
DownloadMonitor downloadMonitor,
ApplicationUpdaterCallback callback)
public void run()
protected void doUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
ApplicationInfo info)
throws Exception
vfsConfig - le proxy a utiliser pour la connexion a l'urlinfo - information sur l'application a mettre a jourExceptionprotected File downloadUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig, ApplicationInfo info, String srcPath) throws IOException
vfsConfig - configuration of vsf (info - srcPath - source path de la forme vfs2 ex:"zip:http://www.nuiton.org/attachments/download/830/nuiton-utils-2.6.5-deps.zip"org.apache.commons.vfs2.FileSystemExceptionIOExceptionprotected void explodeUpdate(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
ApplicationInfo info,
String archiveType,
File source,
File target)
throws org.apache.commons.vfs2.FileSystemException,
UpdateInvalidArchiveLayoutException
target.
Si le répertoire cible existe déjà, il sera alors vidé.
Si l'archive ne contient pas exactement un répertoire alors une exception est levéearchiveType - le type de l'archivesource - l'archive à décompressertarget - le répertoire cibleorg.apache.commons.vfs2.FileSystemExceptionUpdateInvalidArchiveLayoutException - si l'archive n'a pas le bon format@Deprecated protected 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 org.nuiton.util.config.ApplicationConfig getUpdaterConfig(org.apache.commons.vfs2.FileSystemOptions vfsConfig,
String vfsPropertiesUrl)
throws Exception
Exceptionprotected org.apache.commons.vfs2.FileSystemOptions getVFSConfig(org.nuiton.util.config.ApplicationConfig config)
config - protected Map<String,String> getCurrentVersion(List<String> apps, File dir)
apps - la liste des applications a rechercherCopyright © 2013 CodeLutin. All Rights Reserved.