use of io.nosqlbench.docapi.DocsNameSpace in project nosqlbench by nosqlbench.
the class BundledMarkdownZipExporter method exportDocs.
public void exportDocs(Path out) {
ZipOutputStream zipstream;
try {
OutputStream stream = Files.newOutputStream(out, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
zipstream = new ZipOutputStream(stream);
zipstream.setMethod(ZipOutputStream.DEFLATED);
zipstream.setLevel(9);
DocsBinder docsNameSpaces = BundledMarkdownLoader.loadBundledMarkdown();
for (DocsNameSpace docs_ns : docsNameSpaces) {
for (Path p : docs_ns) {
addEntry(p, p.getParent(), zipstream);
}
}
zipstream.finish();
stream.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of io.nosqlbench.docapi.DocsNameSpace in project nosqlbench by nosqlbench.
the class DocsysMarkdownEndpoint method enable.
private void enable(Set<String> enabled) {
for (DocsNameSpace nsinfo : docsinfo) {
// add namespaces which are neither enabled nor disabled to the default group
if (nsinfo.isEnabledByDefault()) {
if (disabled != null && disabled.getPathMap().containsKey(nsinfo.getName())) {
continue;
}
enables.add(nsinfo.getName());
}
}
if (enabled.isEmpty()) {
// Nothing is enabled or enabled by default, so enable everything
this.enabled = new Docs().merge(docsinfo);
this.disabled = new Docs().asDocsBinder();
} else {
// At least one thing was enabled by default, or previously enabled specifically
this.disabled = new Docs().merge(docsinfo);
this.enabled = disabled.remove(enabled);
}
}
Aggregations