Package org.dspace.rdf.negotiation
Class Negotiator
- java.lang.Object
-
- org.dspace.rdf.negotiation.Negotiator
-
public class Negotiator extends Object
- Author:
- Pascal-Nicolas Becker (dspace -at- pascal -hyphen- becker -dot- de)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_LANGstatic intHTMLstatic intN3static intRDFXMLstatic intTURTLEstatic intUNSPECIFIEDstatic intWILDCARD
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Comparator<MediaRange>getMediaRangeComparator()Method to get a comparator to compare media ranges regarding their content negotiation precedence.static intnegotiate(String acceptHeader)static booleansendRedirect(javax.servlet.http.HttpServletResponse response, String handle, String extraPathInfo, int serialization, boolean redirectHTML)
-
-
-
Field Detail
-
UNSPECIFIED
public static final int UNSPECIFIED
- See Also:
- Constant Field Values
-
WILDCARD
public static final int WILDCARD
- See Also:
- Constant Field Values
-
HTML
public static final int HTML
- See Also:
- Constant Field Values
-
RDFXML
public static final int RDFXML
- See Also:
- Constant Field Values
-
TURTLE
public static final int TURTLE
- See Also:
- Constant Field Values
-
N3
public static final int N3
- See Also:
- Constant Field Values
-
DEFAULT_LANG
public static final String DEFAULT_LANG
- See Also:
- Constant Field Values
-
-
Method Detail
-
negotiate
public static int negotiate(String acceptHeader)
-
getMediaRangeComparator
public static Comparator<MediaRange> getMediaRangeComparator()
Method to get a comparator to compare media ranges regarding their content negotiation precedence. Following RFC 2616 a media range is higher prioritized then another media range if the first one has a higher quality value then the second. If both quality values are equal, the media range that is more specific should be used.Note: this comparator imposes orderings that are inconsistent with equals! Caution should be exercised when using it to order a sorted set or a sorted map. Take a look at the java.util.Comparator for further information.
- Returns:
- A comparator that imposes orderings that are inconsistent with equals!
-
sendRedirect
public static boolean sendRedirect(javax.servlet.http.HttpServletResponse response, String handle, String extraPathInfo, int serialization, boolean redirectHTML) throws IOException- Throws:
IOException
-
-