Example usage for com.liferay.portal.kernel.servlet HttpHeaders ACCEPT_ENCODING

List of usage examples for com.liferay.portal.kernel.servlet HttpHeaders ACCEPT_ENCODING

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.servlet HttpHeaders ACCEPT_ENCODING.

Prototype

String ACCEPT_ENCODING

To view the source code for com.liferay.portal.kernel.servlet HttpHeaders ACCEPT_ENCODING.

Click Source Link

Usage

From source file:com.liferay.wsrp.bind.MarkupServiceImpl.java

License:Open Source License

protected void addHeaders(MimeRequest mimeRequest, Http.Options httpOptions) {

    ClientData clientData = mimeRequest.getClientData();

    Extension[] extensions = clientData.getExtensions();

    MessageElement[] clientAttributes = ExtensionUtil.getMessageElements(extensions);

    for (MessageElement clientAttribute : clientAttributes) {
        String name = clientAttribute.getName();
        String value = clientAttribute.getValue();

        if (name.equalsIgnoreCase(HttpHeaders.ACCEPT_ENCODING)
                || name.equalsIgnoreCase(HttpHeaders.CONTENT_LENGTH)
                || name.equalsIgnoreCase(HttpHeaders.CONTENT_TYPE)
                || name.equalsIgnoreCase(HttpHeaders.COOKIE)) {

            continue;
        }/*  w w  w.j a v a2 s.c o m*/

        httpOptions.addHeader(name, value);
    }
}

From source file:com.liferay.wsrp.bind.V2MarkupServiceImpl.java

License:Open Source License

protected void addHeaders(MimeRequest mimeRequest, Http.Options httpOptions) {

    ClientData clientData = mimeRequest.getClientData();

    Extension[] extensions = clientData.getExtensions();

    MessageElement[] clientAttributes = ExtensionHelperUtil.getMessageElements(extensions);

    if (clientAttributes == null) {
        return;//from  w w  w.j  a  va  2s . c  o  m
    }

    for (MessageElement clientAttribute : clientAttributes) {
        String name = ExtensionHelperUtil.getNameAttribute(clientAttribute);
        String value = clientAttribute.getValue();

        if (StringUtil.equalsIgnoreCase(name, HttpHeaders.ACCEPT_ENCODING)
                || StringUtil.equalsIgnoreCase(name, HttpHeaders.CONTENT_LENGTH)
                || StringUtil.equalsIgnoreCase(name, HttpHeaders.CONTENT_TYPE)
                || StringUtil.equalsIgnoreCase(name, HttpHeaders.COOKIE)) {

            continue;
        }

        httpOptions.addHeader(name, value);
    }
}