use of org.xwiki.xar.XarFile in project xwiki-platform by xwiki.
the class DiffXarJob method diff.
private void diff(InstalledExtension installedExtension, String namespace, Set<LocalDocumentReference> alreadydone) {
Collection<ExtensionId> excludedExtensions = getRequest().getExcludedExtensions();
if (XarExtensionHandler.TYPE.equals(installedExtension.getType()) && (excludedExtensions == null || !excludedExtensions.contains(installedExtension.getId()))) {
if (getRequest().isVerbose()) {
this.logger.info("Computing differences for [{}] on namespace [{}]", installedExtension.getId(), namespace);
}
try {
WikiReference wikiReference = new WikiReference(XarHandlerUtils.getWikiFromNamespace(namespace));
diff(new XarFile(new File(installedExtension.getFile().getAbsolutePath())), wikiReference, installedExtension.getId(), alreadydone);
} catch (UnsupportedNamespaceException e) {
this.logger.error("Failed to extract the wiki id from the namespace [{}].", namespace, e);
} catch (IOException e) {
this.logger.error("Failed to read the XAR file of the extension [{}].", installedExtension.getId(), e);
} catch (XarException e) {
this.logger.error("Failed to parse the XAR file of the extension [{}].", installedExtension.getId(), e);
}
}
}
Aggregations