public String getContentType() { return mediaType.getContentType() ; }
public String getMediaType() { return mediaType.getContentType() ; } public String getCharset() { return mediaType.getCharset() ; }
public String getContentType() { return mediaType.getContentType() ; } public String getCharset() { return mediaType.getCharset() ; }
public String getMediaType() { return mediaType.getContentType() ; } public String getCharset() { return mediaType.getCharset() ; }
TypedInputStreamHttp(InputStream input, MediaType mt, ClientConnectionManager connectMgr) { super(input, mt.getContentType(), mt.getCharset(), null) ; this.connectMgr = connectMgr ; }
public static String getCharsetForContentType(String contentType) { MediaType ct = MediaType.create(contentType) ; if ( ct.getCharset() != null ) return ct.getCharset() ; String mt = ct.getContentType() ; if ( contentTypeNTriples.equals(mt) ) return charsetUTF8 ; if ( contentTypeNTriplesAlt.equals(mt) ) return charsetASCII ; if ( contentTypeNQuads.equals(mt) ) return charsetUTF8 ; if ( contentTypeNQuadsAlt1.equals(mt) ) return charsetASCII ; if ( contentTypeNQuadsAlt2.equals(mt) ) return charsetASCII ; return charsetUTF8 ; }
public static String getCharsetForContentType(String contentType) { MediaType ct = MediaType.create(contentType) ; if ( ct.getCharset() != null ) return ct.getCharset() ; String mt = ct.getContentType() ; if ( contentTypeNTriples.equals(mt) ) return charsetUTF8 ; if ( contentTypeNTriplesAlt.equals(mt) ) return charsetASCII ; if ( contentTypeNQuads.equals(mt) ) return charsetUTF8 ; if ( contentTypeNQuadsAlt1.equals(mt) ) return charsetASCII ; if ( contentTypeNQuadsAlt2.equals(mt) ) return charsetASCII ; return charsetUTF8 ; }
/** Negotiate the content-type and set the response headers */ public static MediaType contentNegotation(HttpAction action, AcceptList myPrefs, MediaType defaultMediaType) { MediaType mt = ConNeg.chooseContentType(action.request, myPrefs, defaultMediaType) ; if ( mt == null ) return null ; if ( mt.getContentType() != null ) action.response.setContentType(mt.getContentType()) ; if ( mt.getCharset() != null ) action.response.setCharacterEncoding(mt.getCharset()) ; return mt ; }
/** Negotiate the content-type and set the response headers */ public static MediaType contentNegotation(HttpAction action, AcceptList myPrefs, MediaType defaultMediaType) { MediaType mt = ConNeg.chooseContentType(action.request, myPrefs, defaultMediaType) ; if ( mt == null ) return null ; if ( mt.getContentType() != null ) action.response.setContentType(mt.getContentType()) ; if ( mt.getCharset() != null ) action.response.setCharacterEncoding(mt.getCharset()) ; return mt ; }
mimeType = i.getContentType() ;
mimeType = i.getContentType() ;
mimeType = i.getContentType() ;
mimeType = i.getContentType() ;
Lang lang = RDFLanguages.contentTypeToLang(mediaType.getContentType()) ; action.id, mediaType.getContentType(), mediaType.getCharset(), lang.getName())) ;
Lang lang = RDFLanguages.contentTypeToLang(mediaType.getContentType()) ; if ( lang == null ) lang = RDFLanguages.TRIG ; mediaType.getContentType(), mediaType.getCharset(), lang.getName())) ; if ( !RDFLanguages.isQuads(lang) ) ServletOps.errorBadRequest("Not a quads format: " + mediaType) ;
Lang lang = RDFLanguages.contentTypeToLang(mediaType.getContentType()) ; action.id, mediaType.getContentType(), mediaType.getCharset(), lang.getName())) ;
Lang lang = RDFLanguages.contentTypeToLang(mediaType.getContentType()) ; if ( lang == null ) lang = RDFLanguages.TRIG ; mediaType.getContentType(), mediaType.getCharset(), lang.getName())) ; if ( !RDFLanguages.isQuads(lang) ) ServletOps.errorBadRequest("Not a quads format: " + mediaType) ;
@Test void should_get_for_graphiql() throws Exception { Thread.sleep(1000); final String path = basePath + config.getGraphqlConfig().port() + config.getGraphqlConfig().graphiQLPath(); final Envelope envelope = getPath(path, "application/json"); final String contentType = envelope.getContentType(); assertNotNull(contentType); final MediaType mediaType = MediaType.createFromContentType(contentType); assertEquals("text/html", mediaType.getContentType()); }