Package org.apache.tomcat.lite.http.MultiMap

Examples of org.apache.tomcat.lite.http.MultiMap.Entry


        assertEquals(3, lmap.map.size());

        assertEquals("bar3", lmap.getString("a"));
        assertEquals("bar3", lmap.getString("A"));
        assertEquals("bar1", lmap.getString("Foo"));
        Entry entry = lmap.getEntry("FOO");
        assertEquals(2, entry.values.size());
    }
View Full Code Here


     * Expensive, creates a copy on each call.
     * @param name
     * @return
     */
    public String[] getParameterValues(String name) {
        Entry entry = getParameters().getEntry(name);
        if (entry == null) {
            return null;
        }
        String[] values = new String[entry.values.size()];
        for (int j = 0; j < values.length; j++) {
View Full Code Here

    public Map<String, String[]> getParameterMap() {
        // we could allow 'locking' - I don't think this is
        // a very useful optimization
        Map<String, String[]> map = new HashMap();
        for (int i = 0; i < getParameters().size(); i++) {
            Entry entry = getParameters().getEntry(i);
            if (entry == null) {
                continue;
            }
            if (entry.key == null) {
                continue;
View Full Code Here

    // TODO
    void serializeParameters(Appendable cc) throws IOException {
        int keys = parameters.size();
        boolean notFirst = false;
        for (int i = 0; i < parameters.size(); i++) {
            Entry entry = parameters.getEntry(i);
            for (int j = 0; j < entry.values.size(); j++) {
                // TODO: Uencode
                if (notFirst) {
                    cc.append('&');
                } else {
View Full Code Here

            req.serverName().setString(req.localName().toString());

            MultiMap mimeHeaders = httpReq.getMimeHeaders();
            MimeHeaders coyoteHeaders = req.getMimeHeaders();
            for (int i = 0; i < mimeHeaders.size(); i++ ) {
                Entry entry = mimeHeaders.getEntry(i);
                MessageBytes val =
                    coyoteHeaders.addValue(entry.getName().toString());
                val.setString(entry.getValue().toString());
            }
        }
View Full Code Here

            MultiMap mimeHeaders = httpRes.getMimeHeaders();
            MimeHeaders coyoteHeaders = res.getMimeHeaders();
            for (int i = 0; i < coyoteHeaders.size(); i++ ) {
                MessageBytes name = coyoteHeaders.getName(i);
                MessageBytes val = coyoteHeaders.getValue(i);
                Entry entry = mimeHeaders.addEntry(name.toString());
                entry.getValue().set(val.toString());
            }
            String contentType = res.getContentType();
            if (contentType != null) {
                mimeHeaders.addEntry("Content-Type").getValue().set(contentType);
            }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.lite.http.MultiMap.Entry

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.