/** Get the content type of an action or return the default. * @param action * @return ContentType */ public static ContentType getContentType(HttpAction action) { return FusekiNetLib.getContentType(action.request) ; } }
/** Get the content type of an action or return the default. * @param action * @return ContentType */ public static ContentType getContentType(HttpAction action) { return FusekiNetLib.getContentType(action.request) ; } }
ContentType ct = FusekiNetLib.getContentType(request) ; boolean mustHaveQueryParam = true ; if ( ct != null ) {
ContentType ct = FusekiNetLib.getContentType(request) ; boolean mustHaveQueryParam = true ; if ( ct != null ) {
private static void bodyAsGraph(HttpAction action, StreamRDF dest) { HttpServletRequest request = action.request ; String base = ActionLib.wholeRequestURL(request) ; ContentType ct = FusekiNetLib.getContentType(request) ; Lang lang = RDFLanguages.contentTypeToLang(ct.getContentType()) ; if ( lang == null ) { ServletOps.errorBadRequest("Unknown content type for triples: " + ct) ; return ; } InputStream input = null ; try { input = request.getInputStream() ; } catch (IOException ex) { IO.exception(ex) ; } // Don't log - assemblers are typically small. // Adding this to the log confuses things. // Reserve logging for data uploads. // long len = request.getContentLengthLong() ; // if ( action.verbose ) { // if ( len >= 0 ) // alog.info(format("[%d] Body: Content-Length=%d, Content-Type=%s, Charset=%s => %s", action.id, len, // ct.getContentType(), ct.getCharset(), lang.getName())) ; // else // alog.info(format("[%d] Body: Content-Type=%s, Charset=%s => %s", action.id, ct.getContentType(), // ct.getCharset(), lang.getName())) ; // } dest.prefix("root", base+"#"); ActionLib.parse(action, dest, input, lang, base) ; } }
private static void bodyAsGraph(HttpAction action, StreamRDF dest) { HttpServletRequest request = action.request ; String base = ActionLib.wholeRequestURL(request) ; ContentType ct = FusekiNetLib.getContentType(request) ; Lang lang = RDFLanguages.contentTypeToLang(ct.getContentType()) ; if ( lang == null ) { ServletOps.errorBadRequest("Unknown content type for triples: " + ct) ; return ; } InputStream input = null ; try { input = request.getInputStream() ; } catch (IOException ex) { IO.exception(ex) ; } // Don't log - assemblers are typically small. // Adding this to the log confuses things. // Reserve logging for data uploads. // long len = request.getContentLengthLong() ; // if ( action.verbose ) { // if ( len >= 0 ) // alog.info(format("[%d] Body: Content-Length=%d, Content-Type=%s, Charset=%s => %s", action.id, len, // ct.getContentType(), ct.getCharset(), lang.getName())) ; // else // alog.info(format("[%d] Body: Content-Type=%s, Charset=%s => %s", action.id, ct.getContentType(), // ct.getCharset(), lang.getName())) ; // } dest.prefix("root", base+"#"); ActionLib.parse(action, dest, input, lang, base) ; } }