Class AbstractUpdater
java.lang.Object
zleurtor.scanmanager.model.update.AbstractUpdater
- Direct Known Subclasses:
MasterUpdater
,SlaveUpdater
The class having in charge to search the updates and apply it (if needed).
- Author:
- Zleurtor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Collection<String>
computePlan
(File archive) Compare some part of the archive and some part of the installed files, then compute the update plan.protected void
mergeConfigurations
(InputStream patchIn, String filename) Merge the configuration contained in the specified input stream with the one contained in the specified file.abstract boolean
update()
Check if an update is available (and install it).
-
Constructor Details
-
AbstractUpdater
public AbstractUpdater()
-
-
Method Details
-
update
public abstract boolean update()Check if an update is available (and install it).- Returns:
- true if an update has been done, false otherwise.
-
computePlan
protected abstract Collection<String> computePlan(File archive) throws FileNotFoundException, IOException, NoSuchAlgorithmException, DigestException, ClassNotFoundException Compare some part of the archive and some part of the installed files, then compute the update plan.- Parameters:
archive
- The new 3D Scan Manager version archive.- Returns:
- The collection of files to extract from the archive.
- Throws:
IOException
- If the new version archive file can not be read.FileNotFoundException
- If the new version archive file does not exist.NoSuchAlgorithmException
- If no Provider supports MD5 or SHA-1 implementation.DigestException
- If a digest error occurs.ClassNotFoundException
- If the Class of a serialized object cannot be found.
-
mergeConfigurations
Merge the configuration contained in the specified input stream with the one contained in the specified file.- Parameters:
patchIn
- The input stream from the patch configuration.filename
- The name of the file containing the current configuration.- Throws:
IOException
- If an input/output error occurs.
-