1 package com.woorea.openstack.connector;
3 import java.io.FilterInputStream;
4 import java.io.IOException;
5 import java.io.InputStream;
6 import java.net.SocketException;
8 import org.jboss.resteasy.client.ClientExecutor;
11 public class RESTEasyInputStream extends FilterInputStream {
13 protected ClientExecutor clientExecutor;
15 public RESTEasyInputStream(InputStream inputStream, ClientExecutor clientExecutor) {
17 this.clientExecutor = clientExecutor;
21 public void close() throws IOException {
23 clientExecutor.close();
24 } catch (Exception e) {
25 // Silently skip errors in the socket close errors
30 } catch (SocketException e) {
31 // We expect this exception because the socket is closed
32 } catch (IllegalStateException e) {
33 // We expect this exception because the socket is closed (httpclient 4.2)