public class Installer extends Downloader
An installer wraps a FilesCollection (db.xml.gz) and can be
used to stage potential changes to that collection.
The start() method is the key to actually doing the work, downloading
new files as needed or creating empty files to signify deletion. These all go
in the update sub-directory, but the update can be finalized with
moveUpdatedIntoPlace().
NB: the installer will only operate on FileObjects in the collection
that have an appropriate FileObject.Status. Thus the first step in updating is
typically to use FileObject.stageForUpdate(FilesCollection, boolean)
or FileObject.stageForUninstall(FilesCollection) as needed, with the
Installer used to activate these staged changes.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
UPDATER_JAR_NAME |
cancelled, count, error, itemCount, itemTotal, lastModified, totalprogress| Constructor and Description |
|---|
Installer(FilesCollection files,
Progress progress) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
deleteOrThrowException(File file) |
static Set<FileObject> |
getUpdaterFiles(FilesCollection files,
org.scijava.command.CommandService commandService,
boolean onlyUpdateable) |
static boolean |
isTheUpdaterUpdateable(FilesCollection files) |
static boolean |
isTheUpdaterUpdateable(FilesCollection files,
org.scijava.command.CommandService commandService) |
protected static boolean |
moveOutOfTheWay(File file) |
void |
moveUpdatedIntoPlace() |
protected void |
moveUpdatedIntoPlace(File sourceDirectory,
File targetDirectory) |
void |
start() |
static void |
updateTheUpdater(FilesCollection files,
Progress progress) |
static void |
updateTheUpdater(FilesCollection files,
Progress progress,
org.scijava.command.CommandService commandService) |
void |
verify(net.imagej.updater.Installer.Download download) |
cancel, download, getLastModified, start, startaddItem, addProgress, done, itemDone, removeProgress, setCount, setItemCount, setTitleprotected static final String UPDATER_JAR_NAME
public Installer(FilesCollection files, Progress progress)
public void start()
throws IOException
IOExceptionpublic static Set<FileObject> getUpdaterFiles(FilesCollection files, org.scijava.command.CommandService commandService, boolean onlyUpdateable)
public static boolean isTheUpdaterUpdateable(FilesCollection files)
public static boolean isTheUpdaterUpdateable(FilesCollection files, org.scijava.command.CommandService commandService)
public static void updateTheUpdater(FilesCollection files, Progress progress) throws IOException
IOExceptionpublic static void updateTheUpdater(FilesCollection files, Progress progress, org.scijava.command.CommandService commandService) throws IOException
IOExceptionpublic void verify(net.imagej.updater.Installer.Download download)
public void moveUpdatedIntoPlace()
throws IOException
IOExceptionprotected void moveUpdatedIntoPlace(File sourceDirectory, File targetDirectory) throws IOException
IOExceptionprotected static void deleteOrThrowException(File file) throws IOException
IOExceptionprotected static boolean moveOutOfTheWay(File file)
Copyright © 2009–2025 ImageJ. All rights reserved.