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

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

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

origin: apache/jena

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

public String toHeaderString()  { return mediaType.toHeaderString() ; }

origin: apache/jena

/**
 * Match a single media type against a header string.
 *
 * @param headerString HTTP header string
 * @param mediaRangeStr Semi-colon separated list of media types
 * @return the matched media type or <code>null</code> if there was no match
 */
public static String match(String headerString, String mediaRangeStr)
{
  AcceptList l = new AcceptList(headerString) ;
  MediaRange aItem = new MediaRange(mediaRangeStr) ;  // MediaType
  MediaType m = l.match(aItem) ;
  if ( m == null )
    return null ;
  return m.toHeaderString() ;
}
origin: org.apache.jena/jena-fuseki-core

/**
 * Match a single media type against a header string.
 *
 * @param headerString HTTP header string
 * @param mediaRangeStr Semi-colon separated list of media types
 * @return the matched media type or <code>null</code> if there was no match
 */
public static String match(String headerString, String mediaRangeStr)
{
  AcceptList l = new AcceptList(headerString) ;
  MediaRange aItem = new MediaRange(mediaRangeStr) ;  // MediaType
  MediaType m = l.match(aItem) ;
  if ( m == null )
    return null ;
  return m.toHeaderString() ;
}
origin: apache/jena

private void testMatch(String header, String offer, String result)
{
  AcceptList list1 = new AcceptList(header) ;
  AcceptList list2 = new AcceptList(offer) ;
  MediaType matchItem = AcceptList.match(list1, list2) ;
  if ( result == null )
  {
    assertNull("Match not null: from "+q(header)+" :: "+q(offer),
          matchItem) ;
    return ;
  }
  assertNotNull("Match is null: expected "+q(result), matchItem) ;
  assertEquals("Match different", result, matchItem.toHeaderString()) ;
}

org.apache.jena.atlas.webMediaTypetoHeaderString

Javadoc

Format for use in HTTP header

Popular methods of MediaType

  • getContentType
  • 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

  • Start an intent from android
  • putExtra (Intent)
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Menu (java.awt)
  • Path (java.nio.file)
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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