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

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

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

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 String toHeaderString() {
  return mediaType.toHeaderString() ;
}
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: apache/jena

public static MediaType create(String string) {
  if ( string == null )
    return null ;
  return new MediaType(parse(string)) ;
}
origin: apache/jena

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

public boolean grounded(MediaType item) {
  return ! isStar(item.getType()) && ! isStar(item.getSubType()) ;
}

origin: apache/jena

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

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

@Override
public boolean equals(Object obj)
{
  if (this == obj) return true ;
  if (obj == null) return false ;
  if (getClass() != obj.getClass()) return false ;
  ContentType other = (ContentType)obj ;
  if (mediaType == null)
  {
    if (other.mediaType != null) return false ;
  } else
    if (!mediaType.equals(other.mediaType)) return false ;
  return true ;
}

origin: apache/jena

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

public static MediaType create(String contentType, String subType, String charset) {
  return new MediaType(contentType, subType, charset) ;
}
origin: apache/jena

@Override
public int hashCode() {
  final int prime = 31 ;
  int result = 1 ;
  result = prime * result + ((mediaType == null) ? 0 : mediaType.hashCode()) ;
  return result ;
}
origin: apache/jena

public String getCharset() {
  return getParameter(strCharset) ;
}
origin: apache/jena

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

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

public static MediaType create(String string) {
  if ( string == null )
    return null ;
  return new MediaType(parse(string)) ;
}
origin: apache/jena

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

public boolean grounded(MediaType item) {
  return ! isStar(item.getType()) && ! isStar(item.getSubType()) ;
}

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

@Override
public boolean equals(Object obj) {
  if ( this == obj )
    return true ;
  if ( obj == null )
    return false ;
  if ( getClass() != obj.getClass() )
    return false ;
  ContentType other = (ContentType)obj ;
  if ( mediaType == null ) {
    if ( other.mediaType != null )
      return false ;
  } else if ( !mediaType.equals(other.mediaType) )
    return false ;
  return true ;
}
org.apache.jena.atlas.webMediaType

Javadoc

A structure to represent a media type. See also the Apache httpd documentation.

Most used methods

  • getContentType
  • toHeaderString
    Format for use in HTTP header
  • create
  • equals
  • getCharset
  • <init>
  • getParameter
  • getSubType
  • getType
  • hashCode
  • parse
  • setParameter
  • parse,
  • setParameter,
  • toString,
  • createFromContentType

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Path (java.nio.file)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for Android Studio
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