Exemple #1
0
 static boolean isEnhanced(final HttpEntity entity) {
   if (entity != null && Proxy.isProxyClass(entity.getClass())) {
     final InvocationHandler handler = Proxy.getInvocationHandler(entity);
     return handler instanceof RequestEntityExecHandler;
   } else {
     return false;
   }
 }
Exemple #2
0
 public void abort() {
   if (isClose || httpEntity == null) return;
   //    System.out.println(" buoc phai abort " + httpEntity + " / " + inputStream+ " / "+
   // hashCode());
   isClose = true;
   try {
     if (httpEntity instanceof BasicManagedEntity) {
       BasicManagedEntity entity = (BasicManagedEntity) httpEntity;
       entity.abortConnection();
     } else {
       LogService.getInstance().setMessage(null, "http entity " + httpEntity.getClass().getName());
       if (httpEntity.getContent() != null) httpEntity.getContent().close();
     }
     //      if(httpEntity != null) httpEntity.consumeContent();
   } catch (IllegalStateException e) {
   } catch (Exception e) {
     LogService.getInstance().setMessage(e, e.toString());
   }
 }