Package org.apache.commons.httpclient

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


        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

            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

        }

        //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

                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

        ChukwaHttpSender.metrics.httpTimeOutException.inc();
      }
     
      log.error(">>>>>> HTTP response from " + dest + " statusLine: " + method.getStatusLine());
      // do something aggressive here
      throw new HttpException("got back a failure from server");
    }
    // implicitly "else"
    log.info(">>>>>> HTTP Got success back from "+ dest + "; response length "
            + method.getResponseContentLength());
View Full Code Here

         case WebdavStatus.SC_OK:
            return true;
         case WebdavStatus.SC_NOT_FOUND:
            return false;
         default:
            HttpException ex = new HttpException();
            ex.setReasonCode(status);
            ex.setReason(head.getStatusText());
            throw ex;
      }
   }
View Full Code Here

               throw new WebdavException("PROPFFIND does not return resourcetype");
            }
         case WebdavStatus.SC_NOT_FOUND:
            return false;
         default:
            HttpException ex = new HttpException();
            ex.setReasonCode(status);
            ex.setReason(propFind.getStatusText());
            throw ex;
      }
   }
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.