use of edu.stanford.bmir.protege.web.server.revision.RevisionManager in project webprotege by protegeproject.
the class ProjectDownloader method exportProjectRevision.
private void exportProjectRevision(@Nonnull String projectDisplayName, @Nonnull RevisionNumber revisionNumber, @Nonnull OutputStream outputStream, @Nonnull DownloadFormat format) throws IOException, OWLOntologyStorageException {
RevisionManager revisionManager = project.getRevisionManager();
OWLOntologyManager manager = revisionManager.getOntologyManagerForRevision(revisionNumber);
OWLOntologyID rootOntologyId = project.getRootOntology().getOntologyID();
Optional<OWLOntology> revisionRootOntology = getOntologyFromManager(manager, rootOntologyId);
if (revisionRootOntology.isPresent()) {
saveImportsClosureToStream(projectDisplayName, revisionRootOntology.get(), format, outputStream, revisionNumber);
} else {
// An error - no flipping ontology!
logger.info("Project download failed because the root ontology could not be retrived from the manager. Project: ", project.getProjectId());
throw new RuntimeException("The ontology could not be downloaded from " + applicationName + ". Please contact the administrator.");
}
}
Aggregations