class RestUtils {

    public static String getMimeHeaderValue(final Context serverContext, final String headerName) {
        final HttpContext httpContext = serverContext.asContext(HttpContext.class);
        final String headerValue = httpContext.getHeaderAsString(headerName);
        try {
            return headerValue == null ? null : MimeUtility.decodeText(headerValue);
        } catch (UnsupportedEncodingException ex) {
            if (debug.warningEnabled()) {
                debug.warning("Unable to decode mime header: " + ex);
            }
            return headerValue;
        }
    }

}