Package org.mortbay.jetty

Examples of org.mortbay.jetty.HttpFields$Field


  public String getResponseHeader(String key) {
    return response.getHeader(key);
  }

  public List<String> getResponseHeaderNameList() {
    HttpFields httpFields = response.getHttpFields();
    List<String> hnList = new ArrayList<String>();
    Enumeration e = httpFields.getFieldNames();
    while (e.hasMoreElements()) {
      hnList.add((String) e.nextElement());
    }
    return hnList;
  }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    public void finish() {
        if (mockRequest.getHttpResponse() instanceof org.mortbay.jetty.Response) {
            HttpFields httpFields = ((org.mortbay.jetty.Response) mockRequest.getHttpResponse()).getHttpFields();

            Enumeration<String> e = httpFields.getFieldNames();
            while (e.hasMoreElements()) {
                String nextElement = e.nextElement();
                responseHeaders.add(nextElement, httpFields.getStringField(nextElement));
            }
        }
    }
View Full Code Here

    return response.getStatus();
  }

  public Map<String, String> buildResponseHeaderMap() {
    Map<String, String> responseHeaderMap = new HashMap<String, String>();
    HttpFields httpFields = response.getHttpFields();
    Enumeration e = httpFields.getFieldNames();
    while (e.hasMoreElements()) {
      String key = (String) e.nextElement();
      String value = response.getHeader(key);
      responseHeaderMap.put(key, value);
    }
View Full Code Here

    return response.getStatus();
  }

  public Map<String, String> buildResponseHeaderMap() {
    Map<String, String> responseHeaderMap = new HashMap<String, String>();
    HttpFields httpFields = response.getHttpFields();
    Enumeration e = httpFields.getFieldNames();
    while (e.hasMoreElements()) {
      String key = (String) e.nextElement();
      String value = response.getHeader(key);
      responseHeaderMap.put(key, value);
    }
View Full Code Here

    return response.getStatus();
  }

  public Map<String, String> buildResponseHeaderMap() {
    Map<String, String> responseHeaderMap = new HashMap<String, String>();
    HttpFields httpFields = response.getHttpFields();
    Enumeration e = httpFields.getFieldNames();
    while (e.hasMoreElements()) {
      String key = (String) e.nextElement();
      String value = response.getHeader(key);
      responseHeaderMap.put(key, value);
    }
View Full Code Here

                EasyMock.expect(request.getQueryString()).andReturn(query);   
                EasyMock.expect(request.getHeader("Accept")).andReturn("*/*")
                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8").times(2);
                EasyMock.expect(request.getAttribute("org.mortbay.jetty.ajax.Continuation")).andReturn(null);
               
                HttpFields httpFields = new HttpFields();
                httpFields.add("content-type", "text/xml");
                httpFields.add("content-type", "charset=utf8");
                httpFields.put(JettyHTTPDestinationTest.AUTH_HEADER, JettyHTTPDestinationTest.BASIC_AUTH);
               
                EasyMock.expect(request.getHeaderNames()).andReturn(httpFields.getFieldNames());
                request.getHeaders("content-type");
                EasyMock.expectLastCall().andReturn(httpFields.getValues("content-type"));
                request.getHeaders(JettyHTTPDestinationTest.AUTH_HEADER);
                EasyMock.expectLastCall().andReturn(
                    httpFields.getValues(JettyHTTPDestinationTest.AUTH_HEADER));
                
                EasyMock.expect(request.getInputStream()).andReturn(is);
                request.setHandled(true);
                EasyMock.expectLastCall()
                response.flushBuffer();
View Full Code Here

        this.request = request;
        buildRequestUrl();
    }

    public String getContentType() {
        HttpFields fields = request.getRequestFields();
        return fields.getStringField("Content-Type");
    }
View Full Code Here

    public void setHeader(String name, String value) {
        request.setRequestHeader(name, value);
    }

    public String getHeader(String name) {
        HttpFields fields = request.getRequestFields();
        return fields.getStringField(name);
    }
View Full Code Here

        return fields.getStringField(name);
    }

    @SuppressWarnings("unchecked")
    public Map<String, String> getAllHeaders() {
        HttpFields fields = request.getRequestFields();
        Iterator iter = fields.getFields();
        HashMap<String, String> headers = new HashMap<String, String>();
        while (iter.hasNext()) {
            Field field = (Field) iter.next();
            headers.put(field.getName(), field.getValue());
        }
View Full Code Here

        private HttpFields responseFields;

        private CamelContentExchange(Exchange exchange, AsyncCallback callback) {
            this.exchange = exchange;
            this.callback = callback;
            responseFields = new HttpFields();
        }
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.HttpFields$Field

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.