Package our.apache.commons.httpclient

Examples of our.apache.commons.httpclient.HeaderElement


            final Header header = new Header(headerName, headerValue);
            try {
                // check the elements in the value
                final HeaderElement[] elements = header.getValues();
                for (int i = 0; i < elements.length; i++) {
                    final HeaderElement element = elements[i];
                    // no element value expected here
                    if (element.getValue() == null) {
                        final String elementName = element.getName();
                        // if the value contains a colon then it is a profile
                        // URL, otherwise a profile-diff name
                        if (elementName.indexOf(':') >= 0) {
                            // only interested in profile URLs
                            String url = elementName;
View Full Code Here


            final Header header = new Header("Opt", optValue);
            try {
                // iterate over the values to collect namespace ID's
                final HeaderElement[] values = header.getValues();
                for (int i = 0; i < values.length; i++) {
                    final HeaderElement element = values[i];
                    // remove the optional " characters from the beginning and
                    // the end of the name
                    String elementName = element.getName();
                    if (elementName.length() > 1 &&
                        elementName.charAt(0) == '"' &&
                        elementName.charAt(elementName.length() - 1) == '"') {
                        elementName =
                            elementName.substring(1, elementName.length() - 1);
                    }
                    // we are interested in the CC/PP Exchange namespace only
                    if (element.getValue() == null &&
                        elementName.equalsIgnoreCase(
                            "http://www.w3.org/1999/06/24-CCPPexchange")) {
                        final NameValuePair parameter =
                            element.getParameterByName("ns");
                        String paramValue = parameter.getValue();
                        if (paramValue != null) {
                            String namespace = null;
                            paramValue = paramValue.trim();
                            // check if it is a 2 digit number
View Full Code Here

TOP

Related Classes of our.apache.commons.httpclient.HeaderElement

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.