Examples of consumeContent()


Examples of org.apache.http.HttpEntity.consumeContent()

          } else {
            size = -1;
          }
        }
        if (size > MAX_DOWNLOAD_SIZE) {
          entity.consumeContent();
          return PageFetchStatus.PageTooBig;
        }

        boolean isBinary = false;
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

        logger.error(e.getMessage() + " while fetching " + page.getWebURL().getURL());
      }
    } finally {
      try {
        if (entity != null) {
          entity.consumeContent();
        } else if (get != null) {
          get.abort();
        }
      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

        pullParser.nextTag(); // Tag.VALUE (<value>)
        // no parser.require() here since its called in XMLRPCSerializer.deserialize() below
       
        // deserialize result
        Object obj = iXMLRPCSerializer.deserialize(pullParser);
        entity.consumeContent();
        return obj;
      } else
      if (tag.equals(Tag.FAULT)) {
        // fault response
        pullParser.nextTag(); // Tag.VALUE (<value>)
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

        // deserialize fault result
        Map<String, Object> map = (Map<String, Object>) iXMLRPCSerializer.deserialize(pullParser);
        String faultString = (String) map.get(Tag.FAULT_STRING);
        int faultCode = (Integer) map.get(Tag.FAULT_CODE);
        entity.consumeContent();
        throw new XMLRPCFault(faultString, faultCode);
      } else {
        entity.consumeContent();
        throw new XMLRPCException("Bad tag <" + tag + "> in XMLRPC response - neither <params> nor <fault>");
      }
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

        String faultString = (String) map.get(Tag.FAULT_STRING);
        int faultCode = (Integer) map.get(Tag.FAULT_CODE);
        entity.consumeContent();
        throw new XMLRPCFault(faultString, faultCode);
      } else {
        entity.consumeContent();
        throw new XMLRPCException("Bad tag <" + tag + "> in XMLRPC response - neither <params> nor <fault>");
      }
    } catch (XMLRPCException e) {
      // catch & propagate XMLRPCException/XMLRPCFault
      throw e;
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

                    if (this.forceClose) {
                        httpget.abort();
                    } else {
                        HttpEntity entity = response.getEntity();
                        if (entity != null) {
                            entity.consumeContent();
                        }
                    }
                }
            } catch (Exception ex) {
                this.exception = ex;
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

                   
                    this.context.setAttribute("r" + r, conn.getState());
                   
                    HttpEntity entity = response.getEntity();
                    if (entity != null) {
                        entity.consumeContent();
                    }
                }
               
            } catch (Exception ex) {
                this.exception = ex;
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

        } catch (ConnectionPoolTimeoutException expected) {
        }
       
        HttpEntity e = response.getEntity();
        assertNotNull(e);
        e.consumeContent();
       
        // Expect one connection in the pool
        assertEquals(1, mgr.getConnectionsInPool());

        // Make sure one connection is available
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

        HttpGet httpget = new HttpGet("/test/");
       
        HttpResponse response1 = client.execute(getServerHttp(), httpget, context);
        HttpEntity e1 = response1.getEntity();
        if (e1 != null) {
            e1.consumeContent();
        }
       
        List<Cookie> cookies = cookieStore.getCookies();
        assertNotNull(cookies);
        assertEquals(1, cookies.size());
View Full Code Here

Examples of org.apache.http.HttpEntity.consumeContent()

        assertEquals(1, cookies.size());

        HttpResponse response2 = client.execute(getServerHttp(), httpget, context);
        HttpEntity e2 = response2.getEntity();
        if (e2 != null) {
            e2.consumeContent();
        }
       
        HttpRequest reqWrapper = (HttpRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
       
        Header cookiesupport = reqWrapper.getFirstHeader("Cookie2");
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.