/** * Handle namespace create. */ @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { if (req.getRequestURI().endsWith("/dataloader")) { // See BLZG-1713 // Invoke the Data Loader if(log.isDebugEnabled()) { log.debug(""); } doBulkLoad(req, resp); return; } /* * Pass through to the SPARQL end point REST API. * */ m_restServlet.doPost(req, resp); }
throws IOException { if (!isWritable(getServletContext(), req, resp)) { buildAndCommitResponse(resp, HTTP_BADREQUEST, MIME_TEXT_PLAIN, "Content-Type not recognized as Properties: " + contentType); buildAndCommitResponse(resp, HTTP_INTERNALERROR, MIME_TEXT_PLAIN, "Parser factory not found: Content-Type=" + contentType final AbstractTripleStore kb = (AbstractTripleStore) getBigdataRDFContext().getIndexManager() .getResourceLocator().locate(namespace, ITx.UNISOLATED); submitApiTask(new RestApiCreateKBTask(req, resp, namespace, kbProps)).get(); } catch (Throwable t) { submitApiTask( new DataLoaderTask(req, resp, namespace, ITx.UNISOLATED, props)).get(); buildAndCommitResponse(resp, HTTP_OK, MIME_TEXT_PLAIN, "DATALOADER-SERVLET: Loaded " + namespace + " with properties: " + propertyFile);
/** * Overridden to create and initialize the delegate {@link Servlet} * instances. */ @Override public void init() throws ServletException { super.init(); m_restServlet = new RESTServlet(); m_restServlet.init(getServletConfig()); }
throws IOException { if (!isWritable(getServletContext(), req, resp)) { buildAndCommitResponse(resp, HTTP_BADREQUEST, MIME_TEXT_PLAIN, "Content-Type not recognized as Properties: " + contentType); buildAndCommitResponse(resp, HTTP_INTERNALERROR, MIME_TEXT_PLAIN, "Parser factory not found: Content-Type=" + contentType final AbstractTripleStore kb = (AbstractTripleStore) getBigdataRDFContext().getIndexManager() .getResourceLocator().locate(namespace, ITx.UNISOLATED); submitApiTask(new RestApiCreateKBTask(req, resp, namespace, kbProps)).get(); } catch (Throwable t) { submitApiTask( new DataLoaderTask(req, resp, namespace, ITx.UNISOLATED, props)).get(); buildAndCommitResponse(resp, HTTP_OK, MIME_TEXT_PLAIN, "DATALOADER-SERVLET: Loaded " + namespace + " with properties: " + propertyFile);
/** * Overridden to create and initialize the delegate {@link Servlet} * instances. */ @Override public void init() throws ServletException { super.init(); m_restServlet = new RESTServlet(); m_restServlet.init(getServletConfig()); }
/** * Handle namespace create. */ @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { if (req.getRequestURI().endsWith("/dataloader")) { // See BLZG-1713 // Invoke the Data Loader if(log.isDebugEnabled()) { log.debug(""); } doBulkLoad(req, resp); return; } /* * Pass through to the SPARQL end point REST API. * */ m_restServlet.doPost(req, resp); }