use of org.xwiki.extension.repository.LocalExtensionRepositoryException in project xwiki-platform by xwiki.
the class RepairXarJob method getLocalXARExtension.
/**
* @param extensionId the extension unique identifier
* @return the stored local extension
* @throws InstallException failed to store extension
*/
private LocalExtension getLocalXARExtension(ExtensionId extensionId) throws InstallException {
LocalExtension localExtension = this.localRepository.getLocalExtension(extensionId);
if (localExtension == null) {
this.progressManager.pushLevelProgress(2, this);
try {
this.progressManager.startStep(this);
Extension extension = this.repositoryManager.resolve(extensionId);
this.progressManager.endStep(this);
this.progressManager.startStep(this);
if (extension.getType().equals(XarExtensionHandler.TYPE)) {
localExtension = this.localExtensionRepository.storeExtension(extension);
}
this.progressManager.endStep(this);
} catch (ResolveException e) {
throw new InstallException("Failed to find extension", e);
} catch (LocalExtensionRepositoryException e) {
throw new InstallException("Failed save extension in local repository", e);
} finally {
this.progressManager.popLevelProgress(this);
}
} else if (!localExtension.getType().equals(XarExtensionHandler.TYPE)) {
localExtension = null;
}
return localExtension;
}
Aggregations