Tabnine Logo
MediaType.getContentType
Code IndexAdd Tabnine to your IDE (free)

How to use
getContentType
method
in
org.apache.jena.atlas.web.MediaType

Best Java code snippets using org.apache.jena.atlas.web.MediaType.getContentType (Showing top 18 results out of 315)

origin: apache/jena

public String getContentType() {
  return mediaType.getContentType() ;
}
origin: apache/jena

public String getMediaType()                { return mediaType.getContentType() ; }
public String getCharset()                  { return mediaType.getCharset() ; }
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public String getContentType()  { return mediaType.getContentType() ; }
public String getCharset()      { return mediaType.getCharset() ; }
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public String getMediaType()                { return mediaType.getContentType() ; }
public String getCharset()                  { return mediaType.getCharset() ; }
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

TypedInputStreamHttp(InputStream input, MediaType mt, ClientConnectionManager connectMgr)
{
  super(input, mt.getContentType(), mt.getCharset(), null) ;
  this.connectMgr = connectMgr ;
}

origin: apache/jena

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 ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

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 ;
}
origin: apache/jena

/** 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 ;
}

origin: org.apache.jena/jena-fuseki-core

/** 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 ;
}

origin: apache/jena

mimeType = i.getContentType() ;
origin: apache/jena

mimeType = i.getContentType() ;
origin: org.apache.jena/jena-fuseki-core

mimeType = i.getContentType() ;
origin: org.apache.jena/jena-fuseki-core

mimeType = i.getContentType() ;
origin: apache/jena

Lang lang = RDFLanguages.contentTypeToLang(mediaType.getContentType()) ;
          action.id, mediaType.getContentType(), mediaType.getCharset(), lang.getName())) ;
origin: apache/jena

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) ;
origin: org.apache.jena/jena-fuseki-core

Lang lang = RDFLanguages.contentTypeToLang(mediaType.getContentType()) ;
          action.id, mediaType.getContentType(), mediaType.getCharset(), lang.getName())) ;
origin: org.apache.jena/jena-fuseki-core

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) ;
origin: semantic-integration/hypergraphql

@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());
}
org.apache.jena.atlas.webMediaTypegetContentType

Popular methods of MediaType

  • toHeaderString
    Format for use in HTTP header
  • create
  • equals
  • getCharset
  • <init>
  • getParameter
  • getSubType
  • getType
  • hashCode
  • parse
  • setParameter
  • toString
    Format to show structure - intentionally different from header form so you can tell parsing happened
  • setParameter,
  • toString,
  • createFromContentType

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • startActivity (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Permission (java.security)
    Legacy security code; do not use.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now