Package com.volantis.mcs.http

Examples of com.volantis.mcs.http.HttpHeaders


        request.setHeaders(headers);
        context.setDevicePolicyValue(DevicePolicyConstants.DEFAULT_OUTPUT_CHARSET,
                                     deviceCharset);
        context.setDevicePolicyValue(DevicePolicyConstants.FORCED_OUTPUT_CHARSET,
                                     forcedCharset);
        HttpHeaders rHeaders = HttpServletFactory.
                getDefaultInstance().getHTTPHeaders(request);

        try {
            // Create simple accessor for use in the tests
            TestPolicyDescriptorAccessor accessor =
View Full Code Here


            // Select the best charset that we could find from the accept headers.
            EncodingManager encodingManager = appContext.getEncodingManager();
            AcceptCharsetSelector selector = new AcceptCharsetSelector(
                    encodingManager);
            HttpHeaders rHeaders = HttpFactory.getDefaultInstance()
                    .createHTTPHeaders();
            String charset = selector.selectCharset(rHeaders,
                (DefaultDevice) context.getDevice().getDevice());
            if (charset != null) {
                // Use the selected charset.
View Full Code Here

            // Select the best charset that we could find from the accept headers.
            EncodingManager encodingManager = appContext.getEncodingManager();
            AcceptCharsetSelector selector = new AcceptCharsetSelector(
                    encodingManager);
            HttpHeaders rHeaders = HttpServletFactory.
                    getDefaultInstance().getHTTPHeaders(request);
            String charset = selector.selectCharset(rHeaders,
                (DefaultDevice) context.getDevice().getDevice());
            if (charset != null) {
                // Use the selected charset.
View Full Code Here

*/
public class DefaultHttpServletFactory extends HttpServletFactory {

    // javadoc inherited.
    public HttpHeaders getHTTPHeaders(final HttpServletRequest request) {
        return new HttpHeaders() {
            // javadoc inherited.
            public String getHeader(String name) {
                return request.getHeader(name);
            }

View Full Code Here

            // Use the device repository to retrieve the device.
            DeviceRepository deviceRepository;
            try {
                deviceRepository = getRuntimeDeviceRepository();

                HttpHeaders headers = servletFactory.getHTTPHeaders(request);
                String defaultDeviceName = volantisBean.getDevicesConfiguration().getDefaultDeviceName();

                // null value of defaultDeviceName is OK, it means that
                // we let DeviceRepository subsystem use its own default               
                device = (DefaultDevice) deviceRepository
View Full Code Here

            (DefaultDevice) internalDevice.getDevice();
        defaultDevice.setPolicyValue(DevicePolicyConstants.DEFAULT_OUTPUT_CHARSET,
                                      deviceCharset);
        defaultDevice.setPolicyValue(DevicePolicyConstants.FORCED_OUTPUT_CHARSET,
                                      forcedCharset);
        HttpHeaders rHeaders = HttpServletFactory.
                getDefaultInstance().getHTTPHeaders(request);
        String charset = selector.selectCharset(rHeaders,
            (DefaultDevice) context.getDevice().getDevice());
        if (expected != null) {
            assertEquals("Expected value should match", expected, charset);
View Full Code Here

            if (logger.isDebugEnabled()) {
                logger.debug(
                    "Retrieved device " + device + " from the session");
            }
        } else {
            HttpHeaders httpHeaders = HttpServletFactory.getDefaultInstance().
                    getHTTPHeaders(httpRequest);

            device = deviceReader.getDevice(
                    new ServletRequestHeaders(httpHeaders));
        }
View Full Code Here

        HttpServletRequest httpRequest =
                ((MarinerServletRequestContext) requestContext).
                getHttpRequest();

        HttpHeaders httpHeaders = HttpServletFactory.getDefaultInstance().
                getHTTPHeaders(httpRequest);

        return HTTPHeadersHelper.hasAcceptMimeType(httpHeaders, mimeType);
    }
View Full Code Here

     */
    public InternalDevice getDevice(LocalRepositoryConnection connection,
                                    RequestHeaders requestHeaders)
            throws RepositoryException {

        HttpHeaders headers = null;

        // todo this is nasty and may be avoided if the ServletRequestHeaders is moved to an appropriate package, or something else
        if (requestHeaders instanceof ServletRequestHeaders) {
            headers = ((ServletRequestHeaders)requestHeaders).getHttpHeaders();
        }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.http.HttpHeaders

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.