use of org.xwiki.filter.input.InputSource in project xwiki-platform by xwiki.
the class WikiReader method read.
public void read(Object filter, XARInputFilter proxyFilter) throws IOException, FilterException {
InputStream stream;
InputSource source = this.properties.getSource();
if (source instanceof InputStreamInputSource) {
stream = ((InputStreamInputSource) source).getInputStream();
} else {
throw new FilterException("Unsupported source type [" + source.getClass() + "]");
}
read(stream, filter, proxyFilter);
// Close remaining opened spaces
if (this.documentReader.getSentSpaceReference() != null) {
for (EntityReference space = this.documentReader.getSentSpaceReference(); space != null; space = space.getParent()) {
proxyFilter.endWikiSpace(space.getName(), FilterEventParameters.EMPTY);
}
}
// Send extension event
if (this.xarPackage.getPackageExtensionId() != null) {
proxyFilter.beginExtension(this.xarPackage.getPackageExtensionId(), this.xarPackage.getPackageVersion(), FilterEventParameters.EMPTY);
proxyFilter.endExtension(this.xarPackage.getPackageExtensionId(), this.xarPackage.getPackageVersion(), FilterEventParameters.EMPTY);
}
}
Aggregations