Package org.apache.jena.atlas.web

Examples of org.apache.jena.atlas.web.AcceptList


    // HTTP: RDF
    //See WebContent.defaultGraphAcceptHeader, defaultDatasetAcceptHeader, defaultRDFAcceptHeader
   
    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),
View Full Code Here


    //  Accept: application/sparql-results+json , application/sparql-results+xml;q=0.9 , application/rdf+xml , application/turtle;q=0.9 , */*;q=0.1
    //  Offer:  application/sparql-results+xml, application/sparql-results+json, text/csv , text/tab-separated-values, text/plain
   
    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),
View Full Code Here

        } catch (RuntimeException ex) { return null ; }
    }
   
    static public MediaType match(String headerString, AcceptList offerList)
    {
        AcceptList l = new AcceptList(headerString) ;
        return AcceptList.match(l, offerList) ;
    }
View Full Code Here

    }

    /** Match a single media type against a header string */
    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() ;
    }
View Full Code Here

                                    MediaType defaultMediaType)
    {
        if ( headerString == null )
            return defaultMediaType ;
       
        AcceptList headerList = new AcceptList(headerString) ;
       
        if ( myPrefs == null )
        {
            MediaType i = headerList.first() ;
            if ( i == null ) return defaultMediaType ;
            return i ;
        }
   
        MediaType i = AcceptList.match(headerList, myPrefs) ;
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.web.AcceptList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.