Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpException


                DocumentBuilderFactory factory =
                    DocumentBuilderFactory.newInstance();
                factory.setNamespaceAware(true);
                builder = factory.newDocumentBuilder();
            } catch (ParserConfigurationException e) {
                throw new HttpException
                    ("XML Parser Configuration error: " + e.getMessage());
            }
        }

        try {
View Full Code Here


                DocumentBuilderFactory factory =
                    DocumentBuilderFactory.newInstance();
                factory.setNamespaceAware(true);
                builder = factory.newDocumentBuilder();
            } catch (ParserConfigurationException e) {
                throw new HttpException
                    ("XML Parser Configuration error: " + e.getMessage());
            }
        }

        try {
View Full Code Here

                return resourcesToXml(resources);
            } else {
                BufferedInputStream bi = null;
                bi = new BufferedInputStream(this.resource.getMethodData());
                if (!this.resource.exists()) {
                    throw new HttpException(this.systemId + "does not exist");
                }
                return bi;
            }
        } catch (HttpException he) {
            throw new SourceException("Could not get WebDAV resource " + getSecureURI(), he);
View Full Code Here

                    getData.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(10, true));
                    int executeMethod;
                    try {
                        executeMethod = HTTPConnection.executeMethod(getData);
                        if (executeMethod != HttpStatus.SC_OK) {
                            JXAenvUtils._popExceptionToUser(false, Thread.currentThread(), new HttpException(JXAenvUtils.log("Error occured with HTTP GET connection to " + src, JXAenvUtils.LVL.APP_ERR)));
                        }
                        inputStream.close();
                        inputStream = getData.getResponseBodyAsStream();
                    } catch (Exception ex) {
                        if (JXAenvUtils._debugSys) {
View Full Code Here

                DocumentBuilderFactory factory =
                    DocumentBuilderFactory.newInstance();
                factory.setNamespaceAware(true);
                builder = factory.newDocumentBuilder();
            } catch (ParserConfigurationException e) {
                throw new HttpException
                    ("XML Parser Configuration error: " + e.getMessage());
            }
        }

        try {
View Full Code Here

        }
        CheckUrlsCommand command;
        final HttpClient client = createNiceMock(HttpClient.class);
        try {
            expect(client.executeMethod(isA(HttpMethod.class))).andThrow(
                    new HttpException()).anyTimes();
            expect(client.getHttpConnectionManager()).andReturn(
                    new MultiThreadedHttpConnectionManager()).anyTimes();
            replay(client);

            command = new CheckUrlsCommand(null, client);
View Full Code Here

   */
  protected void validateResponse(HttpInvokerClientConfiguration config, PostMethod postMethod)
      throws IOException {

    if (postMethod.getStatusCode() >= 300) {
      throw new HttpException(
          "Did not receive successful HTTP response: status code = " + postMethod.getStatusCode() +
          ", status message = [" + postMethod.getStatusText() + "]");
    }
  }
View Full Code Here

            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

            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

        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

TOP

Related Classes of org.apache.commons.httpclient.HttpException

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.