Examples of HttpConnection


Examples of org.eclipse.jetty.server.HttpConnection

            ? (Request)req : HttpConnection.getCurrentConnection().getRequest();
           
        if (!"HEAD".equals(req.getMethod())) {
            //bug in Jetty with persistent connections that if a HEAD is
            //sent, a _head flag is never reset
            HttpConnection c = baseRequest.getConnection();
            if (c != null) {
                c.getGenerator().setHead(false);
            }
        }
        if (getServer().isSetRedirectURL()) {
            resp.sendRedirect(getServer().getRedirectURL());
            resp.flushBuffer();
View Full Code Here

Examples of org.eclipse.jgit.transport.http.HttpConnection

    @Override
    FileStream open(final String path) throws IOException {
      final URL base = httpObjectsUrl;
      final URL u = new URL(base, path);
      final HttpConnection c = httpOpen(u);
      switch (HttpSupport.response(c)) {
      case HttpConnection.HTTP_OK:
        final InputStream in = openInputStream(c);
        final int len = c.getContentLength();
        return new FileStream(in, len);
      case HttpConnection.HTTP_NOT_FOUND:
        throw new FileNotFoundException(u.toString());
      default:
        throw new IOException(u.toString() + ": " //$NON-NLS-1$
            + HttpSupport.response(c) + " " //$NON-NLS-1$
            + c.getResponseMessage());
      }
    }
View Full Code Here

Examples of org.exoplatform.common.http.client.HTTPConnection

      AuthorizationHandler ah = AuthorizationInfo.getAuthHandler();

      try
      {
         URL url = new URL(sUrl);
         HTTPConnection connection = new HTTPConnection(url);
         connection.removeModule(CookieModule.class);
         AuthorizationInfo.setAuthHandler(null);

         HTTPResponse resp = connection.Get(url.getFile());

         String authHeader = resp.getHeader("WWW-Authenticate");

         String realm = authHeader.split("=")[1];
         realm = realm.substring(1, realm.length() - 1);
View Full Code Here

Examples of org.expath.httpclient.HttpConnection

        final EXistResult result;
       
        if(parser.getSendAuth()) {
            result = sendOnceWithAuth(uri, request, parser.getCredentials());       
        } else {
            HttpConnection conn = null;
            try {
                conn = new ApacheHttpConnection(uri);
                final EXistResult firstResult = new EXistResult(context);
                final HttpResponse response = request.send(firstResult, conn, null);
                if(response.getStatus() == 401) {
                    conn.disconnect();
                    result = sendOnceWithAuth(uri, request, parser.getCredentials());
                } else {
                    result = firstResult;
                    registerConnectionWithContext(conn);
                }
            } catch(final HttpClientException hce) {
                if(conn != null) {
                    try {
                        conn.disconnect();
                    } catch(final HttpClientException hcee) {
                        logger.warn(hcee.getMessage(), hcee);
                    }
                }
                throw hce;
View Full Code Here

Examples of org.jivesoftware.openfire.http.HttpConnection

            // - silently discard the packet without notifying anyone
            //   - actually, give the initiator a URL to post to w/ token?
            // - servlet continues where the POSTed file left off
           
            HttpSession httpSession = (HttpSession)initiatorSession;
            HttpConnection httpConnection = (HttpConnection)httpSession.getConnection();
           
           
            // does getServerName include port? is it the actual HTTP host name?
            String transferPostUrl = "http://"+httpSession.getServerName()+"/fileupload.jsp";
View Full Code Here

Examples of org.mortbay.jetty.HttpConnection

    }

    /* ------------------------------------------------------------------------------- */
    protected Connection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint)
    {
        HttpConnection connection=(HttpConnection)super.newConnection(channel,endpoint);
        ((HttpParser)connection.getParser()).setForceContentBuffer(true);
        return connection;
    }
View Full Code Here

Examples of org.mortbay.jetty.HttpConnection

    }

    /* ------------------------------------------------------------------------------- */
    protected Connection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint)
    {
        HttpConnection connection=(HttpConnection)super.newConnection(channel,endpoint);
        ((HttpParser)connection.getParser()).setForceContentBuffer(true);
        return connection;
    }
View Full Code Here

Examples of org.mortbay.jetty.HttpConnection

            super(request,response,contentLength,bufferSize,minGzipSize);
        }

        protected boolean setContentEncodingGzip()
        {
            HttpConnection connection = HttpConnection.getCurrentConnection();
            connection.getResponseFields().put("Content-Encoding", "gzip");
            return true;
        }
View Full Code Here

Examples of org.mortbay.jetty.HttpConnection

    public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException
    {
        HttpConnection.getCurrentConnection().getRequest().setHandled(true);
        response.setContentType(MimeTypes.TEXT_HTML_8859_1);
        ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096);
        HttpConnection connection = HttpConnection.getCurrentConnection();
        handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
        writer.flush();
        response.setContentLength(writer.size());
        writer.writeTo(response.getOutputStream());
        writer.destroy();
    }
View Full Code Here

Examples of org.mortbay.jetty.HttpConnection

    }

    /* ------------------------------------------------------------------------------- */
    protected Connection newConnection(SocketChannel channel,SelectChannelEndPoint endpoint)
    {
        return new HttpConnection(SelectChannelConnector.this,endpoint,getServer());
    }
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.