/** * Cleans up this HTTP call. * * @throws RestCallException Can be thrown by one of the {@link RestCallInterceptor#onClose(RestCall)} calls. */ @Override /* Closeable */ public void close() throws RestCallException { if (response != null && ! softClose) EntityUtils.consumeQuietly(response.getEntity()); if (! softClose) isClosed = true; if (! isFailed) for (RestCallInterceptor r : interceptors) r.onClose(this); }
/** * Add an interceptor for this call only. * * @param interceptor The interceptor to add to this call. * @return This object (for method chaining). */ public RestCall interceptor(RestCallInterceptor interceptor) { interceptors.add(interceptor); interceptor.onInit(this); return this; }
/** * Add an interceptor for this call only. * * @param interceptor The interceptor to add to this call. * @return This object (for method chaining). */ public RestCall interceptor(RestCallInterceptor interceptor) { interceptors.add(interceptor); interceptor.onInit(this); return this; }
/** * Cleans up this HTTP call. * * @throws RestCallException Can be thrown by one of the {@link RestCallInterceptor#onClose(RestCall)} calls. */ @Override /* Closeable */ public void close() throws RestCallException { if (response != null && ! softClose) EntityUtils.consumeQuietly(response.getEntity()); if (! softClose) isClosed = true; if (! isFailed) for (RestCallInterceptor r : interceptors) r.onClose(this); }
/** * Add an interceptor for this call only. * * @param interceptor The interceptor to add to this call. * @return This object (for method chaining). */ public RestCall interceptor(RestCallInterceptor interceptor) { interceptors.add(interceptor); interceptor.onInit(this); return this; }
/** * Cleans up this HTTP call. * * @throws RestCallException Can be thrown by one of the {@link RestCallInterceptor#onClose(RestCall)} calls. */ @Override /* Closeable */ public void close() throws RestCallException { if (response != null && ! softClose) EntityUtils.consumeQuietly(response.getEntity()); if (! softClose) isClosed = true; if (! isFailed) for (RestCallInterceptor r : interceptors) r.onClose(this); }