Package org.owasp.webscarab.model

Examples of org.owasp.webscarab.model.NamedValue


            return nv.getValue();
        }
       
        public void setValueAt(Object aValue, int row, int col) {
            if (_editable && aValue instanceof String) {
                NamedValue nv = _headers.get(row);
                if (col == 0) {
                    _headers.set(row, new NamedValue((String)aValue, nv.getValue()));
                } else {
                    _headers.set(row, new NamedValue(nv.getName(), (String) aValue));
                }
                _modified = true;
                fireTableCellUpdated(row, col);
            }
        }
View Full Code Here


            NamedValue[] values = NamedValue.splitNamedValues(_data, "&", "=");
            String name, value;
            for (int i=0; i<values.length; i++) {
                name = Encoding.urlDecode(values[i].getName());
                value = Encoding.urlDecode(values[i].getValue());
                values[i] = new NamedValue(name, value);
                _values.add(values[i]);
            }
        }
        _tableModel.fireTableDataChanged();
        _modified = false;
View Full Code Here

   
    public byte[] getBytes() {
        if (_editable && isModified()) {
            StringBuffer buff = new StringBuffer();
            for (int i=0; i<_values.size(); i++) {
                NamedValue value = _values.get(i);
                if (value.getName() == null || value.getName().equals("")) continue;
                if (i>0) buff.append("&");
                buff.append(Encoding.urlEncode(value.getName())).append("=");
                if (value.getValue() != null)
                    buff.append(Encoding.urlEncode(value.getValue()));
            }
            _data = buff.toString();
        }
        if (_data == null) {
            return new byte[0];
View Full Code Here

    }
    // </editor-fold>//GEN-END:initComponents
   
    public void insertRow(int row) {
        _values.add(row, new NamedValue("Variable", "value"));
        _modified = true;
        _tableModel.fireTableRowsInserted(row, row);
    }
View Full Code Here

            return _values.size();
        }
       
        public Object getValueAt(int row, int column) {
            if (row > _values.size()-1) return "ERROR";
            NamedValue nv = _values.get(row);
            if (column == 0) return nv.getName();
            return nv.getValue();
        }
View Full Code Here

            return nv.getValue();
        }
       
        public void setValueAt(Object aValue, int row, int col) {
            if (_editable && aValue instanceof String) {
                NamedValue nv = _values.get(row);
                if (col == 0) {
                    _values.set(row, new NamedValue((String)aValue, nv.getValue()));
                } else {
                    _values.set(row, new NamedValue(nv.getName(), (String) aValue));
                }
                _modified = true;
                fireTableCellUpdated(row, col);
            }
        }
View Full Code Here

            if (0 == attributeValueNodeList.getLength()) {
                continue;
            }
            Element attributeValueElement = (Element) attributeValueNodeList.item(0);
            String attributeValue = attributeValueElement.getChildNodes().item(0).getNodeValue();
            NamedValue attribute = new NamedValue(attributeName, attributeValue);
            samlAttributes.add(attribute);
        }

        NodeList attribute2NodeList = document.getElementsByTagNameNS("urn:oasis:names:tc:SAML:2.0:assertion", "Attribute");
        for (int idx = 0; idx < attribute2NodeList.getLength(); idx++) {
            Element attributeElement = (Element) attribute2NodeList.item(idx);
            String attributeName = attributeElement.getAttribute("Name");
            NodeList attributeValueNodeList = attributeElement.getElementsByTagNameNS("urn:oasis:names:tc:SAML:2.0:assertion", "AttributeValue");
            if (0 == attributeValueNodeList.getLength()) {
                continue;
            }
            Element attributeValueElement = (Element) attributeValueNodeList.item(0);
            String attributeValue = attributeValueElement.getChildNodes().item(0).getNodeValue();
            NamedValue attribute = new NamedValue(attributeName, attributeValue);
            samlAttributes.add(attribute);
        }

        return samlAttributes;
    }
View Full Code Here

            if (0 == attributeValueNodeList.getLength()) {
                continue;
            }
            Element attributeValueElement = (Element) attributeValueNodeList.item(0);
            String attributeValue = attributeValueElement.getChildNodes().item(0).getNodeValue();
            NamedValue attribute = new NamedValue(attributeName, attributeValue);
            samlAttributes.add(attribute);
        }

        return samlAttributes;
    }
View Full Code Here

            String value = Encoding.urlDecode(values[i].getValue());
            if ("openid.sig".equals(name)) {
                byte[] decodedSignature = Base64.decode(value);
                decodedSignature[0]++;
                String corruptEncodedSignature = new String(Base64.encode(decodedSignature));
                values[i] = new NamedValue(name, corruptEncodedSignature);
                corruptedSignature = true;
                break;
            }
        }
        if (false == corruptedSignature) {
View Full Code Here

            stringBuffer.append(values[i].getValue());
        }
        if (null != additionalParameters) {
            Iterator additionalAttributesIter = additionalParameters.iterator();
            while (additionalAttributesIter.hasNext()) {
                NamedValue namedValue = (NamedValue) additionalAttributesIter.next();
                if (stringBuffer.length() > 1) {
                    stringBuffer.append("&");
                }
                stringBuffer.append(namedValue.getName());
                stringBuffer.append("=");
                stringBuffer.append(namedValue.getValue());
            }
        }
        byte[] content = stringBuffer.toString().getBytes();
        request.setContent(content);
    }
View Full Code Here

TOP

Related Classes of org.owasp.webscarab.model.NamedValue

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.