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

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

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

origin: apache/jena

public TypedOutputStream(OutputStream out, String mediaType, String charset)
{
  this(out, MediaType.create(mediaType, charset)) ;
}

origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

TypedInputStreamHttp(InputStream input, String contentType, ClientConnectionManager connectMgr)
{
  this(input, MediaType.create(contentType), connectMgr) ;
}

origin: apache/jena

/**
 * Parses the content type. It splits the string by semi-colon and finds the
 * other features such as the "q" quality factor.  For a complete documentation
 * on how the parsing happens, see
 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1</a>.
 *
 * @param contentType content type string
 * @return parsed media type
 */
static public MediaType parse(String contentType)
{
  try {
    return MediaType.create(contentType) ;
  } catch (RuntimeException ex) { return null ; }
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public TypedOutputStream(OutputStream out, String mediaType, String charset)
{
  this(out, MediaType.create(mediaType, charset)) ;
}

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

/**
 * Parses the content type. It splits the string by semi-colon and finds the
 * other features such as the "q" quality factor.  For a complete documentation
 * on how the parsing happens, see
 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1</a>.
 *
 * @param contentType content type string
 * @return parsed media type
 */
static public MediaType parse(String contentType)
{
  try {
    return MediaType.create(contentType) ;
  } catch (RuntimeException ex) { return null ; }
}
origin: apache/jena

public static ContentType create(String string) {
  if ( string == null )
    return null ;
  ContentType ct = new ContentType(MediaType.create(string)) ;
  return ct ;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public static ContentType create(String string)
{
  if ( string == null )
    return null ;
  ContentType ct = new ContentType(MediaType.create(string)) ;
  return ct ;
}

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 ;
}
org.apache.jena.atlas.webMediaTypecreate

Popular methods of MediaType

  • getContentType
  • toHeaderString
    Format for use in HTTP header
  • 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

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Reference (javax.naming)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Best IntelliJ plugins
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