Examples of StatusLine


Examples of com.google.code.http4j.StatusLine

    assertion("HTTP/1.1  204  No Content", "HTTP/1.1", 204, "No Content");
  }
 
  private void assertion(String source, String version, int statusCode, String reason) throws IOException {
    byte[] line = source.getBytes();
    StatusLine statusLine = parser.parse(line);
    Assert.assertNotNull(statusLine);
    Assert.assertEquals(statusLine.getVersion(), version);
    Assert.assertEquals(statusLine.getStatusCode(), statusCode);
    Assert.assertEquals(statusLine.getReason(), reason);
  }
View Full Code Here

Examples of gov.nist.javax.sip.header.StatusLine

    // defined code but extensions may add others (in theory up to 999,
    // but in practice up to 699 since the 6xx range is defined as 'final error')
    if (statusCode < 100 || statusCode > 699)
      throw new ParseException("bad status code", 0);
    if (this.statusLine == null)
      this.statusLine = new StatusLine();
    this.statusLine.setStatusCode(statusCode);
  }
View Full Code Here

Examples of net.noderunner.http.StatusLine

  ServerResponse createServerResponse() throws IOException {
    flushBuffer();
    if (pw != null)
        pw.close();
    setContentLength(baos.size());
    StatusLine sl = new StatusLine(statusCode, statusReason);
    DataPoster dp = new ByteArrayDataPoster(baos.toByteArray());
    ServerResponse sr = new ServerResponse(sl, headers, dp);
    return sr;
  }
View Full Code Here

Examples of org.apache.ace.webui.vaadin.component.StatusLine

        if (auth.hasRole("viewTarget")) {
            m_grid.addComponent(m_targetsPanel, count, 2);
            m_grid.addComponent(m_targetToolbar, count, 1);
        }

        m_statusLine = new StatusLine();

        m_grid.addComponent(m_statusLine, 0, 3, 2, 3);

        m_progress = new ProgressIndicator(0f);
        m_progress.setStyleName("invisible");
View Full Code Here

Examples of org.apache.commons.httpclient.StatusLine

            if (line == null) {
                setKeepAlive(false);
                return null;
            }
            SimpleResponse response = new SimpleResponse(
                    new StatusLine(line),
                    HttpParser.parseHeaders(this.in, HTTP_ELEMENT_CHARSET),
                    this.in);
            return response;
        } catch (IOException e) {
            close();
View Full Code Here

Examples of org.apache.commons.httpclient.StatusLine

            if (line == null) {
                setKeepAlive(false);
                return null;
            }
            SimpleResponse response = new SimpleResponse(
                    new StatusLine(line),
                    HttpParser.parseHeaders(this.in, HTTP_ELEMENT_CHARSET),
                    this.in);
            return response;
        } catch (IOException e) {
            close();
View Full Code Here

Examples of org.apache.commons.httpclient.StatusLine

            if (line == null) {
                setKeepAlive(false);
                return null;
            }
            SimpleResponse response = new SimpleResponse(
                    new StatusLine(line),
                    HttpParser.parseHeaders(this.in, HTTP_ELEMENT_CHARSET),
                    this.in);
            return response;
        } catch (IOException e) {
            close();
View Full Code Here

Examples of org.apache.http.StatusLine

           
            res.sampleEnd(); // Done with the sampling proper.
            currentRequest = null;

            // Now collect the results into the HTTPSampleResult:
            StatusLine statusLine = httpResponse.getStatusLine();
            int statusCode = statusLine.getStatusCode();
            res.setResponseCode(Integer.toString(statusCode));
            res.setResponseMessage(statusLine.getReasonPhrase());
            res.setSuccessful(isSuccessCode(statusCode));

            res.setResponseHeaders(getResponseHeaders(httpResponse));
            if (res.isRedirect()) {
                final Header headerLocation = httpResponse.getLastHeader(HEADER_LOCATION);
View Full Code Here

Examples of org.apache.http.StatusLine

     * response was unsuccessful (>= 300 status code), throws an
     * {@link HttpResponseException}.
     */
    public String handleResponse(final HttpResponse response)
            throws HttpResponseException, IOException {
        StatusLine statusLine = response.getStatusLine();
        if (statusLine.getStatusCode() >= 300) {
            throw new HttpResponseException(statusLine.getStatusCode(),
                    statusLine.getReasonPhrase());
        }

        HttpEntity entity = response.getEntity();
        return entity == null ? null : EntityUtils.toString(entity);
    }
View Full Code Here

Examples of org.apache.http.StatusLine

        TransportAuthenticationProvider<Executor, Executor> authProvider = mock(TransportAuthenticationProvider.class);
        when(authProvider.canAuthenticate(Executor.class)).thenReturn(true);
        Executor executor = mock(Executor.class);
        Response response = mock(Response.class);
        HttpResponse httpResponse = mock(HttpResponse.class);
        StatusLine statusLine = mock(StatusLine.class);
        when(statusLine.getStatusCode()).thenReturn(404);
        when(httpResponse.getStatusLine()).thenReturn(statusLine);
        when(response.returnResponse()).thenReturn(httpResponse);
        when(executor.execute(any(Request.class))).thenReturn(response);
        when(authProvider.authenticate(any(Executor.class), any(TransportAuthenticationContext.class))).thenReturn(executor);
        ReplicationEndpoint endpoint = new ReplicationEndpoint("http://127.0.0.1:8080/some/resource");
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.