public class FusekiErrorHandler extends ErrorHandler
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
{
AbstractHttpConnection connection = AbstractHttpConnection.getCurrentConnection();
connection.getRequest().setHandled(true);
String method = request.getMethod();
if(!method.equals(HttpMethods.GET) && !method.equals(HttpMethods.POST) && !method.equals(HttpMethods.HEAD))
return;
response.setContentType(MimeTypes.TEXT_PLAIN_UTF_8) ;
response.setHeader(HttpHeaders.CACHE_CONTROL, "must-revalidate,no-cache,no-store") ;
ByteArrayOutputStream bytes = new ByteArrayOutputStream(1024) ;
//String writer = IO.UTF8(null) ;
Writer writer = new OutputStreamWriter(bytes, "UTF-8") ;
handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
if ( ! Fuseki.VERSION.equalsIgnoreCase("development") )
{
writer.write("\n") ;
writer.write("\n") ;