Skip to content

Commit 06fea21

Browse files
author
Marcus Linke
committed
Fix Issue #110
1 parent dae60a4 commit 06fea21

14 files changed

Lines changed: 19 additions & 16 deletions

src/main/java/com/github/dockerjava/jaxrs/BuildImageCmdExec.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public Iterable<EventStreamItem> getItems() throws IOException {
8181
ObjectReader reader = mapper.reader(EventStreamItem.class);
8282
// and then do other configuration, if any, and read:
8383
Iterator<EventStreamItem> items = reader.readValues(proxy);
84+
85+
proxy.close();
8486

8587
return ImmutableList.copyOf(items);
8688
}

src/main/java/com/github/dockerjava/jaxrs/CopyFileFromContainerCmdExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected InputStream execute(CopyFileFromContainerCmd command) {
3030

3131
LOGGER.trace("POST: " + webResource.toString());
3232

33-
return webResource.request().accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).post(entity(command, MediaType.APPLICATION_JSON), Response.class).readEntity(InputStream.class);
33+
return webResource.request().accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).post(entity(command, MediaType.APPLICATION_JSON)).readEntity(InputStream.class);
3434
}
3535

3636
}

src/main/java/com/github/dockerjava/jaxrs/InfoCmdExec.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ protected Info execute(InfoCmd command) {
2323
WebTarget webResource = getBaseResource().path("/info");
2424

2525
LOGGER.trace("GET: {}", webResource);
26-
return webResource.request().accept(MediaType.APPLICATION_JSON).get(Info.class); }
26+
return webResource.request().accept(MediaType.APPLICATION_JSON).get(Info.class);
27+
}
2728

2829
}

src/main/java/com/github/dockerjava/jaxrs/KillContainerCmdExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected Void execute(KillContainerCmd command) {
2929
}
3030

3131
LOGGER.trace("POST: {}", webResource);
32-
webResource.request().accept(MediaType.APPLICATION_JSON).post(null);
32+
webResource.request().accept(MediaType.APPLICATION_JSON).post(null).close();
3333

3434
return null;
3535
}

src/main/java/com/github/dockerjava/jaxrs/LogContainerCmdExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected InputStream execute(LogContainerCmd command) {
2929
.queryParam("tail", command.getTail() < 0 ? "all" : "" + command.getTail());
3030

3131
LOGGER.trace("GET: {}", webResource);
32-
return webResource.request().get(Response.class).readEntity(InputStream.class);
32+
return webResource.request().get().readEntity(InputStream.class);
3333
}
3434

3535
}

src/main/java/com/github/dockerjava/jaxrs/PauseContainerCmdExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected Void execute(PauseContainerCmd command) {
2626
command.getContainerId());
2727

2828
LOGGER.trace("POST: {}", webResource);
29-
webResource.request().accept(MediaType.APPLICATION_JSON).post(null);
29+
webResource.request().accept(MediaType.APPLICATION_JSON).post(null).close();
3030

3131
return null;
3232
}

src/main/java/com/github/dockerjava/jaxrs/PingCmdExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protected Void execute(PingCmd command) {
2121
WebTarget webResource = getBaseResource().path("/_ping");
2222

2323
LOGGER.trace("GET: {}", webResource);
24-
webResource.request().get(Response.class);
24+
webResource.request().get().close();
2525

2626
return null;
2727
}

src/main/java/com/github/dockerjava/jaxrs/PushImageCmdExec.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public Iterable<PushEventStreamItem> getItems() throws IOException {
7474
// and then do other configuration, if any, and read:
7575
Iterator<PushEventStreamItem> items = reader.readValues(proxy);
7676

77+
proxy.close();
78+
7779
return ImmutableList.copyOf(items);
7880
}
7981

src/main/java/com/github/dockerjava/jaxrs/RemoveContainerCmdExec.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ protected Void execute(RemoveContainerCmd command) {
2323
.queryParam("force", command.hasForceEnabled() ? "1" : "0");
2424

2525
LOGGER.trace("DELETE: {}", webResource);
26-
/*String response = */webResource.request().accept(MediaType.APPLICATION_JSON).delete().close();
27-
// LOGGER.trace("Response: {}", response);
26+
webResource.request().accept(MediaType.APPLICATION_JSON).delete().close();
2827

2928
return null;
3029
}

src/main/java/com/github/dockerjava/jaxrs/RestartContainerCmdExec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected Void execute(RestartContainerCmd command) {
2727
.queryParam("t", String.valueOf(command.getTimeout()));
2828

2929
LOGGER.trace("POST: {}", webResource);
30-
webResource.request().accept(MediaType.APPLICATION_JSON).post(null);
30+
webResource.request().accept(MediaType.APPLICATION_JSON).post(null).close();
3131

3232
return null;
3333
}

0 commit comments

Comments
 (0)