congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BoxLayout (javax.swing)
  • 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