public class Updater extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARG_NOSTART |
static java.lang.String |
ARG_UPDATE |
static java.lang.String |
BACKUP_DIRECTORY |
static java.lang.String |
ICYKERNEL_NAME |
static java.lang.String |
ICYUPDATER_NAME |
static java.lang.String |
UPDATE_BASE_NAME |
static java.lang.String |
UPDATE_DIRECTORY |
static java.lang.String |
UPDATE_EXT_NAME |
static java.lang.String |
UPDATE_NAME |
static java.lang.String |
UPDATER_NAME |
static java.lang.String |
VERSION_NAME |
Constructor and Description |
---|
Updater() |
Modifier and Type | Method and Description |
---|---|
static boolean |
backup(java.lang.String localPath)
Backup the specified local file
|
static void |
clearElementInfos(ElementDescriptor updateElement,
java.util.ArrayList<ElementDescriptor> localElements)
Update local elements according to changes presents in updateElement
|
static void |
deleteObsoletes()
Delete obsoletes files
|
static ElementDescriptor |
findElement(java.lang.String name,
java.util.ArrayList<ElementDescriptor> list)
Find an element in the specified list
|
static java.util.ArrayList<ElementDescriptor> |
getLocalElements()
Get the list of local elements.
|
static java.util.ArrayList<java.lang.String> |
getObsoletes()
Get the list of obsoletes files
|
static java.util.ArrayList<ElementDescriptor> |
getOnlineElements()
Get the list of online elements (online update.xml file)
|
static java.util.ArrayList<ElementDescriptor> |
getUpdateElements(java.util.ArrayList<ElementDescriptor> localElements)
Get update elements.
|
static boolean |
hasUpdateFiles()
Return true if some update files are present in the update directory
|
static java.util.ArrayList<ElementDescriptor> |
loadElementsFromXML(java.lang.String path) |
static boolean |
needUpdate(java.lang.String localPath,
long dateModif)
Return true if specified file is different from the update file (in Update directory)
|
static boolean |
restore()
Process to restoration (in case the update failed)
|
static boolean |
saveElementsToXML(java.util.ArrayList<ElementDescriptor> elements,
java.lang.String path,
boolean onlineSave)
Save the specified elements to the specified filename
|
static boolean |
udpateElement(ElementDescriptor updateElement,
java.util.ArrayList<ElementDescriptor> localElements)
Update the specified "update" element (move files from update to application directory)
then modify local elements list according to changes made. |
static void |
updateElementInfos(ElementDescriptor updateElement,
java.util.ArrayList<ElementDescriptor> localElements)
Update local elements according to changes presents in updateElement
|
static boolean |
updateFile(ElementDescriptor.ElementFile file)
Update the specified local file
|
static boolean |
updateFile(java.lang.String localPath,
long dateModif)
Update the specified local file
|
static boolean |
updateFiles(java.util.ArrayList<ElementDescriptor.ElementFile> files)
Update the specified files
|
static void |
validateElements(java.util.ArrayList<ElementDescriptor> elements)
Validate the specified list of elements against local files.
|
public static final java.lang.String ICYKERNEL_NAME
public static final java.lang.String ICYUPDATER_NAME
public static final java.lang.String UPDATE_DIRECTORY
public static final java.lang.String BACKUP_DIRECTORY
public static final java.lang.String UPDATE_BASE_NAME
public static final java.lang.String UPDATE_EXT_NAME
public static final java.lang.String UPDATE_NAME
public static final java.lang.String VERSION_NAME
public static final java.lang.String UPDATER_NAME
public static final java.lang.String ARG_NOSTART
public static final java.lang.String ARG_UPDATE
public Updater()
public static void validateElements(java.util.ArrayList<ElementDescriptor> elements)
public static java.util.ArrayList<ElementDescriptor> getLocalElements()
public static java.util.ArrayList<ElementDescriptor> getOnlineElements()
public static java.util.ArrayList<ElementDescriptor> getUpdateElements(java.util.ArrayList<ElementDescriptor> localElements)
public static java.util.ArrayList<java.lang.String> getObsoletes()
public static java.util.ArrayList<ElementDescriptor> loadElementsFromXML(java.lang.String path)
public static boolean saveElementsToXML(java.util.ArrayList<ElementDescriptor> elements, java.lang.String path, boolean onlineSave)
public static ElementDescriptor findElement(java.lang.String name, java.util.ArrayList<ElementDescriptor> list)
public static boolean hasUpdateFiles()
public static boolean udpateElement(ElementDescriptor updateElement, java.util.ArrayList<ElementDescriptor> localElements)
public static void clearElementInfos(ElementDescriptor updateElement, java.util.ArrayList<ElementDescriptor> localElements)
public static void updateElementInfos(ElementDescriptor updateElement, java.util.ArrayList<ElementDescriptor> localElements)
public static boolean updateFiles(java.util.ArrayList<ElementDescriptor.ElementFile> files)
public static boolean updateFile(ElementDescriptor.ElementFile file)
public static boolean backup(java.lang.String localPath)
public static boolean updateFile(java.lang.String localPath, long dateModif)
public static boolean needUpdate(java.lang.String localPath, long dateModif)
public static boolean restore()
public static void deleteObsoletes()