Examples of FluentCaseInsensitiveStringsMap


Examples of com.ning.http.client.FluentCaseInsensitiveStringsMap

                    return;
                }

                Realm newRealm = null;
                ProxyServer proxyServer = request.getProxyServer() != null ? request.getProxyServer() : config.getProxyServer();
                final FluentCaseInsensitiveStringsMap headers = request.getHeaders();
                final RequestBuilder builder = new RequestBuilder(future.getRequest());

                if (realm != null && !future.getURI().getPath().equalsIgnoreCase(realm.getUri())) {
                    builder.setUrl(future.getURI().toString());
                }
View Full Code Here

Examples of com.ning.http.client.FluentCaseInsensitiveStringsMap

        this.response = response;
        headers = computerHeaders();
    }

    private FluentCaseInsensitiveStringsMap computerHeaders() {
        FluentCaseInsensitiveStringsMap h = new FluentCaseInsensitiveStringsMap();
        for (String s : response.getHeaderNames()) {
            for (String header : response.getHeaders(s)) {
                h.add(s, header);
            }
        }

        if (trailingHeaders != null && trailingHeaders.getHeaderNames().size() > 0) {
            for (final String s : trailingHeaders.getHeaderNames()) {
                for (String header : response.getHeaders(s)) {
                    h.add(s, header);
                }
            }
        }

        return h;
View Full Code Here

Examples of com.ning.http.client.FluentCaseInsensitiveStringsMap

    @Override
    public com.ning.http.client.AsyncHandler.STATE onHeadersReceived(HttpResponseHeaders h)
        throws Exception
    {
        FluentCaseInsensitiveStringsMap headers = (h == null) ? null : h.getHeaders();
        _headers = headers;
        String comps = (headers == null) ? null : headers.getFirstValue(ClusterMateConstants.HTTP_HEADER_COMPRESSION);
        if (comps != null && !comps.isEmpty()) {
            Uncompressor uncomp = null;
            Compression c = Compression.from(comps);
            if (c == Compression.LZF) {
                uncomp = new LZFUncompressor(this);
View Full Code Here

Examples of com.ning.http.client.FluentCaseInsensitiveStringsMap

                throw new RuntimeException(e);
            }
            parts.add(filePart);
        }

        MultipartRequestEntity requestEntity = new MultipartRequestEntity(parts.toArray(new Part[parts.size()]), new FluentCaseInsensitiveStringsMap());
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            requestEntity.writeRequest(baos);
        } catch (IOException e) {
            throw new RuntimeException(e);
View Full Code Here

Examples of com.ning.http.client.FluentCaseInsensitiveStringsMap

    @Override
    public com.ning.http.client.AsyncHandler.STATE onHeadersReceived(HttpResponseHeaders h)
        throws Exception
    {
        FluentCaseInsensitiveStringsMap headers = (h == null) ? null : h.getHeaders();
        _headers = headers;
        String comps = (headers == null) ? null : headers.getFirstValue(ClusterMateConstants.HTTP_HEADER_COMPRESSION);
        if (comps != null && !comps.isEmpty()) {
            Uncompressor uncomp = null;
            Compression c = Compression.from(comps);
            if (c == Compression.LZF) {
                uncomp = new LZFUncompressor(this);
View Full Code Here

Examples of com.ning.http.client.FluentCaseInsensitiveStringsMap

    @Override
    public com.ning.http.client.AsyncHandler.STATE onHeadersReceived(HttpResponseHeaders h)
        throws Exception
    {
        FluentCaseInsensitiveStringsMap headers = (h == null) ? null : h.getHeaders();
        _headers = headers;
        String comps = (headers == null) ? null : headers.getFirstValue(ClusterMateConstants.HTTP_HEADER_COMPRESSION);
        if (comps != null && !comps.isEmpty()) {
            Uncompressor uncomp = null;
            Compression c = Compression.from(comps);
            if (c == Compression.LZF) {
                uncomp = new LZFUncompressor(this);
View Full Code Here

Examples of com.ning.http.client.FluentCaseInsensitiveStringsMap

        }
    }

    private InBoundHeaders getInBoundHeaders(final Response response) throws ExecutionException, InterruptedException {
        final InBoundHeaders headers = new InBoundHeaders();
        FluentCaseInsensitiveStringsMap responseHeaders = response.getHeaders();

        for (FluentCaseInsensitiveStringsMap.Entry<String, List<String>> header : responseHeaders) {
            headers.put(header.getKey(), header.getValue());
        }
View Full Code Here

Examples of org.asynchttpclient.FluentCaseInsensitiveStringsMap

        headerMap.put("foo", Arrays.asList("baz,foo"));
        headerMap.put("baz", Arrays.asList("bar"));
        headerMap.put("bar", Arrays.asList("bla", "blubb"));

        FluentCaseInsensitiveStringsMap map = new FluentCaseInsensitiveStringsMap(headerMap);

        headerMap.remove("foo");
        headerMap.remove("bar");
        headerMap.remove("baz");

        assertEquals(map.keySet(), new LinkedHashSet<String>(Arrays.asList("foo", "baz", "bar")));
        assertEquals(map.getFirstValue("foo"), "baz,foo");
        assertEquals(map.getJoinedValue("foo", ", "), "baz,foo");
        assertEquals(map.get("foo"), Arrays.asList("baz,foo"));
        assertEquals(map.getFirstValue("baz"), "bar");
        assertEquals(map.getJoinedValue("baz", ", "), "bar");
        assertEquals(map.get("baz"), Arrays.asList("bar"));
        assertEquals(map.getFirstValue("bar"), "bla");
        assertEquals(map.getJoinedValue("bar", ", "), "bla, blubb");
        assertEquals(map.get("bar"), Arrays.asList("bla", "blubb"));
    }
View Full Code Here

Examples of org.asynchttpclient.FluentCaseInsensitiveStringsMap

        assertEquals(map.get("bar"), Arrays.asList("bla", "blubb"));
    }

    @Test
    public void mapConstructorNullTest() {
        FluentCaseInsensitiveStringsMap map = new FluentCaseInsensitiveStringsMap((Map<String, Collection<String>>) null);

        assertEquals(map.keySet().size(), 0);
    }
View Full Code Here

Examples of org.asynchttpclient.FluentCaseInsensitiveStringsMap

        assertEquals(map.keySet().size(), 0);
    }

    @Test
    public void copyConstructorTest() {
        FluentCaseInsensitiveStringsMap srcHeaders = new FluentCaseInsensitiveStringsMap();

        srcHeaders.add("foo", "baz,foo");
        srcHeaders.add("baz", Arrays.asList("bar"));
        srcHeaders.add("bar", "bla", "blubb");

        FluentCaseInsensitiveStringsMap map = new FluentCaseInsensitiveStringsMap(srcHeaders);

        srcHeaders.delete("foo");
        srcHeaders.delete("bar");
        srcHeaders.delete("baz");
        assertTrue(srcHeaders.keySet().isEmpty());

        assertEquals(map.keySet(), new LinkedHashSet<String>(Arrays.asList("foo", "baz", "bar")));
        assertEquals(map.getFirstValue("foo"), "baz,foo");
        assertEquals(map.getJoinedValue("foo", ", "), "baz,foo");
        assertEquals(map.get("foo"), Arrays.asList("baz,foo"));
        assertEquals(map.getFirstValue("baz"), "bar");
        assertEquals(map.getJoinedValue("baz", ", "), "bar");
        assertEquals(map.get("baz"), Arrays.asList("bar"));
        assertEquals(map.getFirstValue("bar"), "bla");
        assertEquals(map.getJoinedValue("bar", ", "), "bla, blubb");
        assertEquals(map.get("bar"), Arrays.asList("bla", "blubb"));
    }
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.