}
private void revertComponents() throws ApplicationException {
try {
Stage stage = getStage();
Installation installation = getInstallation();
if (installation.instanceAndInstallInSameDir())
{
File root = installation.getRootDirectory();
stage.move(root, new RevertFileFilter(getReversionFilesDirectory()));
}
else
{
File root = installation.getRootDirectory();
File revFileRoot = new File(getReversionFilesDirectory(),
Installation.HISTORY_BACKUP_FILES_DIR_INSTALL);
stage.move(root, new RevertFileFilter(revFileRoot,true),true);
root = installation.getInstanceDirectory();
revFileRoot = new File(getReversionFilesDirectory(),
Installation.HISTORY_BACKUP_FILES_DIR_INSTANCE);
stage.move(root, new RevertFileFilter(revFileRoot,false),false);
}
// The bits should now be of the new version. Have
// the installation update the build information so
// that it is correct.
LOG.log(Level.INFO, "Reverted bits to " +
installation.getBuildInformation(false));
} catch (IOException e) {
throw ApplicationException.createFileSystemException(
INFO_ERROR_UPGRADING_COMPONENTS.get(), e);
}