Examples of ICharstringValue


Examples of com.fineqt.fpb.lib.api.ICharstringValue

                    fieldResult, fieldMeta);
            if (fieldMeta.getFieldID() == HTTP_CHUNK__LENGTH_LINE) {
                IFactory factory = getPModule().getFactory();
                IContainerValue lengthLine = (IContainerValue)fieldResult.getValue();
                if (lengthLine != null) {
                    ICharstringValue lenValue = (ICharstringValue)lengthLine.getField(
                            HTTP_CHUNK_LENGTH_LINE__CHUNK_LENGTH);
                    IBooleanValue chunked = factory.createBoolean();
                    if (lenValue != null && !lenValue.getText().equals("0")){
                        //hasChunkData
                        chunked.setBoolean(true);
                    } else {
                        //hasChunkData
                        chunked.setBoolean(false);
View Full Code Here

Examples of com.fineqt.fpb.lib.api.ICharstringValue

                assert nameSet != null;
                IRecordSetValue trailer = (IRecordSetValue)itemResult.getValue();
                if (trailer == null) {
                    return ret;
                }
                ICharstringValue name = (ICharstringValue)trailer.getField(HTTP_HEADER__NAME);
                ICharstringValue value = (ICharstringValue)trailer.getField(HTTP_HEADER__VALUE);
                if (name == null || value == null) {
                    return false;
                }
                nameSet.remove(name.getText());
                //仍然有未处理的Trailer才继续List的循环
View Full Code Here

Examples of com.fineqt.fpb.lib.api.ICharstringValue

            return ret;
        }

        private void processHeadersItem(IFactory factory,
                CommonContext.FieldStackMap fieldStack, IRecordSetValue header) {
            ICharstringValue name = (ICharstringValue)header.getField(HTTP_HEADER__NAME);
            ICharstringValue value = (ICharstringValue)header.getField(HTTP_HEADER__VALUE);
            if (name != null && value != null) {
                String nameText = name.getText();
                //Transfer-Encoding
                if (HeaderNames.TRANSFER_ENCODING.equals(nameText)) {
                    if (HeaderValues.CHUNKED.equals(value.getText())) {
                        //chunked
                        IBooleanValue chunked = factory.createBoolean();
                        chunked.setBoolean(true);
                        fieldStack.setTopField(StackFields.CHUNCKED, chunked);
                        //hasBody
                        IBooleanValue hasBody = factory.createBoolean();
                        hasBody.setBoolean(true);
                        fieldStack.setTopField(StackFields.HAS_BODY, hasBody);
                    }
                //Content-Length
                } else if (HeaderNames.CONTENT_LENGTH.equals(nameText)) {
                    try {
                        int contentLength = Integer.parseInt(value.getText());
                        if (contentLength > 0) {
                            //hasBody
                            IBooleanValue hasBody = factory.createBoolean();
                            hasBody.setBoolean(true);
                            fieldStack.setTopField(StackFields.HAS_BODY, hasBody);
                            //contentLength
                            IIntegerValue lenValue = factory.createInteger();
                            lenValue.setInteger(contentLength);
                            fieldStack.setTopField(StackFields.CONTENT_LENGTH, lenValue);
                        }
                    } catch (NumberFormatException e) {
                        //忽略错误长度
                    }
                //Trailer
                } else if (HeaderNames.TRAILER.equals(nameText)) {
                    String[] names = SPACE_DELIMITER.split(value.getText());
                    Set<String> nameSet = new TreeSet<String>();
                    for (int i = 0; i < names.length; i++) {
                        String trailerName = names[i].trim();
                        if (trailerName.length() > 0) {
                            nameSet.add(trailerName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.