public class ApplicationUpdaterActionUpdate extends AbstractApplicationUpdaterAction
| Modifier and Type | Field and Description |
|---|---|
protected ApplicationUpdaterCallback |
callback |
protected File |
destDir |
protected DownloadMonitor |
downloadMonitor |
AUTHENTICATION_KEY, config, currentDir, HTTP_PROXY, URL_KEY, VERSION_KEY, vfsPropertiesUrl| Constructor and Description |
|---|
ApplicationUpdaterActionUpdate(org.nuiton.config.ApplicationConfig config,
String vfsPropertiesUrl,
File currentDir,
File destDir,
DownloadMonitor downloadMonitor,
ApplicationUpdaterCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
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 void |
onUpdateError(String app,
ApplicationInfo info,
Map<String,Exception> appUpdateError,
Exception eee) |
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 necessaires
|
getApplicationName, getCurrentVersion, getUpdaterConfig, getVersions, getVFSConfig, toVfsURLprotected ApplicationUpdaterCallback callback
protected DownloadMonitor downloadMonitor
protected File destDir
public ApplicationUpdaterActionUpdate(org.nuiton.config.ApplicationConfig config,
String vfsPropertiesUrl,
File currentDir,
File destDir,
DownloadMonitor downloadMonitor,
ApplicationUpdaterCallback callback)
public void run()
protected void onUpdateError(String app, ApplicationInfo info, Map<String,Exception> appUpdateError, Exception eee)
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 formatCopyright © 2013 CodeLutin. All rights reserved.