Added a close method to DockerClient · docker-java/docker-java@f2191dd

File tree

1 file changed

lines changed

  • src/main/java/com/github/dockerjava/client

1 file changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -2,10 +2,7 @@

22
33

import static org.apache.commons.io.IOUtils.closeQuietly;

44
5-

import java.io.File;

6-

import java.io.IOException;

7-

import java.io.InputStream;

8-

import java.io.StringWriter;

5+

import java.io.*;

96

import java.net.URI;

107
118

import org.apache.commons.io.IOUtils;

@@ -60,7 +57,7 @@

6057

/**

6158

* @author Konstantin Pelykh (kpelykh@gmail.com)

6259

*/

63-

public class DockerClient {

60+

public class DockerClient implements Closeable {

6461
6562

private Client client;

6663

private WebResource baseResource;

@@ -321,4 +318,10 @@ public static String asString(ClientResponse response) throws IOException {

321318

}

322319

return out.toString();

323320

}

321+
322+

@Override

323+

public void close() throws IOException {

324+

client.destroy();

325+

}

326+
324327

}