Class ZipUpgrader
- java.lang.Object
-
- net.ssehub.easy.reasoning.core.reasoner.IUpgrader
-
- net.ssehub.easy.reasoning.core.reasoner.FileUpgrader
-
- net.ssehub.easy.reasoning.core.reasoner.ZipUpgrader
-
public class ZipUpgrader extends FileUpgrader
An upgrader for zip and file input locations.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description ZipUpgrader(java.net.URI source, java.lang.String dest, java.util.Map<java.lang.String,java.lang.String> files, java.lang.String marker, ProgressObserver observer)Creates an upgrader instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoUpgrade(ReasoningResult result)Performs the upgrade operations.private voidunpackEntryToInstallPath(java.util.zip.ZipInputStream zis, java.util.zip.ZipEntry entry, java.lang.String targetName)Unpacks a ZIP entry to the bundle installation path.private voidunpackZip(java.util.zip.ZipInputStream zis)Unpacks a JESS installation zip.-
Methods inherited from class net.ssehub.easy.reasoning.core.reasoner.FileUpgrader
getExtension, upgrade
-
Methods inherited from class net.ssehub.easy.reasoning.core.reasoner.IUpgrader
allFileMappings, bundleLocationToFile, copy, error, getMappedFile, getMarker, getObserver, getSource, obtainTargetFile, toBundleLocation
-
-
-
-
Constructor Detail
-
ZipUpgrader
public ZipUpgrader(java.net.URI source, java.lang.String dest, java.util.Map<java.lang.String,java.lang.String> files, java.lang.String marker, ProgressObserver observer)Creates an upgrader instance.- Parameters:
source- the source containing the files to upgradedest- the destination bundle locationfiles- the file mapping describing the upgrademarker- an optional marker file withindest(may be null)observer- a progress observer, useProgressObserver.NO_OBSERVERif no observer shall be informed
-
-
Method Detail
-
doUpgrade
protected boolean doUpgrade(ReasoningResult result)
Performs the upgrade operations.- Overrides:
doUpgradein classFileUpgrader- Parameters:
result- the reasoning result to be modified as a side effect- Returns:
trueif performed,falseif node
-
unpackZip
private void unpackZip(java.util.zip.ZipInputStream zis) throws java.io.IOExceptionUnpacks a JESS installation zip.- Parameters:
zis- the ZIP input stream- Throws:
java.io.IOException- any occuring I/O exception
-
unpackEntryToInstallPath
private void unpackEntryToInstallPath(java.util.zip.ZipInputStream zis, java.util.zip.ZipEntry entry, java.lang.String targetName) throws java.io.IOExceptionUnpacks a ZIP entry to the bundle installation path.- Parameters:
zis- the ZIP input streamentry- the ZIP entry to unpacktargetName- the relative name of the target file- Throws:
java.io.IOException- any occuring I/O exception
-
-