Examples of HTTPException


Examples of net.matuschek.http.HttpException

      doc.setDate(System.currentTimeMillis());
      doc.setURL(url);
     
      return doc;
    } catch (Exception e) {
      throw new HttpException(e.getMessage());
    }
  }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpException

      responseCode = httpClient.executeMethod(post);
     
    // Response Code �berpr�fen     
      // codes 200 - 399 gehen durch
      if ( responseCode < 200 || responseCode >= 400)
        throw new HttpException(this.targetURL.toString() +" returns "+post.getStatusLine().toString());
     
    // response
      String writeMsg = "";
      if ( outputFile!=null )
        writeMsg = this.writeResponse(post.getResponseBodyAsStream(), outputFile);
View Full Code Here

Examples of org.apache.commons.httpclient.HttpException

        InputStream input = null;

        try {
            int result = client.executeMethod(method);
            if (result != HttpStatus.SC_OK) {
                throw new HttpException("Got status code " + result + " for call to " + method.getURI());
            }

            input = method.getResponseBodyAsStream();

            JSONObject object = new JSONObject(new JSONTokener(new InputStreamReader(input)));
View Full Code Here

Examples of org.apache.commons.httpclient.HttpException

            setStatusCode(status);
        }
        // Also accept OK sent by buggy servers.
        if (status != HttpStatus.SC_MULTI_STATUS
            && status != HttpStatus.SC_OK) {
            HttpException ex = new HttpException();
            ex.setReasonCode(status);
            throw ex;
        }
        thisResource = false;

        return method.getResponses();
View Full Code Here

Examples of org.apache.commons.httpclient.HttpException

            setStatusCode(method.getStatusLine().getStatusCode());
        }
        // Also accept OK sent by buggy servers.
        if (status != HttpStatus.SC_MULTI_STATUS
            && status != HttpStatus.SC_OK) {
            HttpException ex = new HttpException();
            ex.setReasonCode(status);
            throw ex;
        }
        thisResource = false;

        return method.getResponses();
View Full Code Here

Examples of org.apache.commons.httpclient.HttpException

        int status = client.executeMethod(method);

        // Also accept OK sent by buggy servers.
        if (status != HttpStatus.SC_MULTI_STATUS
            && status != HttpStatus.SC_OK) {
            HttpException ex = new HttpException();
            ex.setReasonCode(status);
            throw ex;
        }

        // It contains the results.
        Vector results = new Vector();
View Full Code Here

Examples of org.apache.commons.httpclient.HttpException

        }

        //slide/tamino delivers status code OK.
        //can be removed when the server sends MULTI_STATUS
        if (status != HttpStatus.SC_MULTI_STATUS && status != HttpStatus.SC_OK) {
            HttpException ex = new HttpException();
            ex.setReasonCode(status);
            throw ex;
        }
        thisResource = false;

        return method.getResponses();
View Full Code Here

Examples of org.apache.cxf.transport.http.HTTPException

            String answer = mortimer.sayHi();
            Assert.fail("Unexpected reply (" + answer + "). Should throw exception");
        } catch (Exception e) {
            Throwable cause = e.getCause();
            Assert.assertEquals(HTTPException.class, cause.getClass());
            HTTPException he = (HTTPException)cause;
            Assert.assertEquals(401, he.getResponseCode());
        }
    }
View Full Code Here

Examples of org.apache.http.HttpException

            response.setParams(this.params);
            this.requestExec.postProcess(response, this.httpProcessor, context);
           
            int status = response.getStatusLine().getStatusCode();
            if (status < 200) {
                throw new HttpException("Unexpected response to CONNECT request: " +
                        response.getStatusLine());
            }
           
            CredentialsProvider credsProvider = (CredentialsProvider)
                context.getAttribute(ClientContext.CREDS_PROVIDER);
View Full Code Here

Examples of org.apache.http.HttpException

            case HttpRouteDirector.LAYER_PROTOCOL:
                managedConn.layerProtocol(context, this.params);
                break;

            case HttpRouteDirector.UNREACHABLE:
                throw new HttpException("Unable to establish route: " +
                        "planned = " + route + "; current = " + fact);
            case HttpRouteDirector.COMPLETE:
                // do nothing
                break;
            default:
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.