use of nu.validator.xml.BaseUriTracker in project validator by validator.
the class VerifierServletTransaction method loadDocumentInput.
/**
* @throws SAXException
* @throws IOException
*/
protected void loadDocumentInput() throws SAXException, IOException {
if (documentInput != null) {
return;
}
if (methodIsGet) {
documentInput = (TypedInputSource) entityResolver.resolveEntity(null, document);
errorHandler.setLoggingOk(true);
} else {
// POST
long len = request.getContentLength();
if (len > SIZE_LIMIT) {
throw new StreamBoundException("Resource size exceeds limit.");
}
documentInput = contentTypeParser.buildTypedInputSource(document, null, postContentType);
documentInput.setByteStream(len < 0 ? new BoundedInputStream(request.getInputStream(), SIZE_LIMIT, document) : request.getInputStream());
documentInput.setSystemId(request.getHeader("Content-Location"));
}
if (imageCollector != null) {
baseUriTracker = new BaseUriTracker(documentInput.getSystemId(), documentInput.getLanguage());
imageCollector.initializeContext(baseUriTracker);
}
}
Aggregations