use of org.apache.solr.request.BinaryQueryResponseWriter in project Solbase by Photobucket.
the class SolbaseDispatchFilter method writeResponse.
private void writeResponse(SolrQueryResponse solrRsp, ServletResponse response, QueryResponseWriter responseWriter, SolrQueryRequest solrReq, Method reqMethod) throws IOException {
if (solrRsp.getException() != null) {
sendError((HttpServletResponse) response, solrRsp.getException());
} else {
// Now write it out
response.setContentType(responseWriter.getContentType(solrReq, solrRsp));
if (Method.HEAD != reqMethod) {
if (responseWriter instanceof BinaryQueryResponseWriter) {
BinaryQueryResponseWriter binWriter = (BinaryQueryResponseWriter) responseWriter;
binWriter.write(response.getOutputStream(), solrReq, solrRsp);
} else {
PrintWriter out = response.getWriter();
responseWriter.write(out, solrReq, solrRsp);
}
}
// else http HEAD request, nothing to write out, waited this long
// just to get ContentType
}
}
Aggregations