org.eaglei.repository.util
Class Formats

java.lang.Object
  extended by org.eaglei.repository.util.Formats

public final class Formats
extends java.lang.Object

This is a static utility class containing constants and utility methods related to ALL formats for input and output data; this includes RDF serialization as well as Boolean and Tuple query results.

Author:
Larry Stone

Method Summary
static org.openrdf.rio.RDFFormat getRDFOutputFormatForMIMEType(java.lang.String mime)
          Find RDFFormat which has a writer that generates the given MIME type.
static java.lang.String negotiateBooleanContent(javax.servlet.http.HttpServletRequest request, java.lang.String format)
          Get negotiated MIME type for Boolean serialization format
static java.lang.String negotiateHTMLorRDFContent(javax.servlet.http.HttpServletRequest request, java.lang.String format)
          Get negotiated MIME type for HTML *or* RDF serialization format Only for Dissemination servlet which prefers to return HTML.
static java.lang.String negotiateRDFContent(javax.servlet.http.HttpServletRequest request, java.lang.String format)
          Get negotiated MIME type for RDF serialization format
static java.lang.String negotiateTupleContent(javax.servlet.http.HttpServletRequest request, java.lang.String format)
          Get negotiated MIME type for Tuple serialization format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

negotiateRDFContent

public static java.lang.String negotiateRDFContent(javax.servlet.http.HttpServletRequest request,
                                                   java.lang.String format)
Get negotiated MIME type for RDF serialization format

Parameters:
request - a HttpServletRequest object.
format - a String object.
Returns:
MIME type of negotated content, never null

negotiateTupleContent

public static java.lang.String negotiateTupleContent(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String format)
Get negotiated MIME type for Tuple serialization format

Parameters:
request - a HttpServletRequest object.
format - a String object.
Returns:
MIME type of negotated content, never null

negotiateBooleanContent

public static java.lang.String negotiateBooleanContent(javax.servlet.http.HttpServletRequest request,
                                                       java.lang.String format)
Get negotiated MIME type for Boolean serialization format

Parameters:
request - a HttpServletRequest object.
format - a String object.
Returns:
MIME type of negotated content, never null

negotiateHTMLorRDFContent

public static java.lang.String negotiateHTMLorRDFContent(javax.servlet.http.HttpServletRequest request,
                                                         java.lang.String format)
Get negotiated MIME type for HTML *or* RDF serialization format Only for Dissemination servlet which prefers to return HTML. This is an EVIL kludge but it is necessary because of broken browsers like Safari (Webkit) and of course MSIE..

Parameters:
request - a HttpServletRequest object.
format - a String object.
Returns:
MIME type of negotated content, never null

getRDFOutputFormatForMIMEType

public static org.openrdf.rio.RDFFormat getRDFOutputFormatForMIMEType(java.lang.String mime)
Find RDFFormat which has a writer that generates the given MIME type. This is distinct (and different) from simply looking up the RDFFormat.forMIMEType() call since we install extra, custom, writers. Note that a parser is NOT necessarily available for the formats returned by this call.

Parameters:
mime - RDF serialization mime type to look up
Returns:
the corresponding RDFFormat object, or null if not found


Copyright © 2009-2011 Eagle-I. All Rights Reserved.