Repository: docker-java/docker-java
Pull request #138 (2015-01-29 21:16:41)

Cfx interop
This should fix some interoperabilty issues with Apache CXF:

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/docker-java-dev/9WhiNnHtteM


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4d70968f..fbf6d65c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,6 @@ Change Log
 
 docker-java-0.10.6-SNAPSHOT
 ---
- * [#137](https://github.com/docker-java/docker-java/pull/137) Multiple volumesFrom option when creating a container 
  * [#135](https://github.com/docker-java/docker-java/pull/135) Update to latest unix-socket-factory 
  * [#134](https://github.com/docker-java/docker-java/pull/134) Remove Google Guava as dependency 
  * [#128](https://github.com/docker-java/docker-java/pull/128) Allow unauthorized pullImageCmd
diff --git a/src/main/java/com/github/dockerjava/api/DockerClient.java b/src/main/java/com/github/dockerjava/api/DockerClient.java
index 53b21260..f7addfa2 100644
--- a/src/main/java/com/github/dockerjava/api/DockerClient.java
+++ b/src/main/java/com/github/dockerjava/api/DockerClient.java
@@ -105,6 +105,7 @@ public interface DockerClient extends Closeable {
 
 	public EventsCmd eventsCmd(EventCallback eventCallback);
 
+	@Override
 	public void close() throws IOException;
 
 }
\ No newline at end of file
diff --git a/src/main/java/com/github/dockerjava/api/command/CommitCmd.java b/src/main/java/com/github/dockerjava/api/command/CommitCmd.java
index 5eb5a3e8..ac0a7bb5 100644
--- a/src/main/java/com/github/dockerjava/api/command/CommitCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/CommitCmd.java
@@ -106,6 +106,7 @@ public interface CommitCmd extends DockerCmd<String>{
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public String exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<CommitCmd, String> {
diff --git a/src/main/java/com/github/dockerjava/api/command/ContainerDiffCmd.java b/src/main/java/com/github/dockerjava/api/command/ContainerDiffCmd.java
index 516ea365..21d99045 100644
--- a/src/main/java/com/github/dockerjava/api/command/ContainerDiffCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/ContainerDiffCmd.java
@@ -13,6 +13,7 @@ public interface ContainerDiffCmd extends DockerCmd<List<ChangeLog>> {
 
 	public ContainerDiffCmd withContainerId(String containerId);
 
+	@Override
 	public String toString();
 
 	/**
@@ -20,6 +21,7 @@ public interface ContainerDiffCmd extends DockerCmd<List<ChangeLog>> {
 	 * @throws InternalServerErrorException server error
 	 * @throws DockerException unexpected http status code
 	 */
+	@Override
 	public List<ChangeLog> exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<ContainerDiffCmd, List<ChangeLog>> {
diff --git a/src/main/java/com/github/dockerjava/api/command/CopyFileFromContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/CopyFileFromContainerCmd.java
index 0ebd3cc1..8d2bfbb4 100644
--- a/src/main/java/com/github/dockerjava/api/command/CopyFileFromContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/CopyFileFromContainerCmd.java
@@ -21,6 +21,7 @@ public interface CopyFileFromContainerCmd extends DockerCmd<InputStream> {
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public InputStream exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<CopyFileFromContainerCmd, InputStream> {
diff --git a/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
index 88a6caf0..2eeda23e 100644
--- a/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
@@ -6,7 +6,6 @@ import com.github.dockerjava.api.model.Capability;
 import com.github.dockerjava.api.model.ExposedPort;
 import com.github.dockerjava.api.model.HostConfig;
 import com.github.dockerjava.api.model.Volume;
-import com.github.dockerjava.api.model.VolumesFrom;
 
 public interface CreateContainerCmd extends DockerCmd<CreateContainerResponse>{
 
@@ -94,9 +93,9 @@ public interface CreateContainerCmd extends DockerCmd<CreateContainerResponse>{
 
 	public CreateContainerCmd withVolumes(Volume... volumes);
 
-	public VolumesFrom[] getVolumesFrom();
+	public String[] getVolumesFrom();
 
-	public CreateContainerCmd withVolumesFrom(VolumesFrom... volumesFrom);
+	public CreateContainerCmd withVolumesFrom(String... volumesFrom);
 	
 	public HostConfig getHostConfig();
 	
diff --git a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
index df26743e..73381d69 100644
--- a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
+++ b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
@@ -75,6 +75,7 @@ public interface DockerCmdExecFactory extends Closeable {
 
 	public EventsCmd.Exec createEventsCmdExec();
 
+	@Override
 	public void close() throws IOException;
 
 }
\ No newline at end of file
diff --git a/src/main/java/com/github/dockerjava/api/command/InspectContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/InspectContainerCmd.java
index ca6a9a69..f67fe4ae 100644
--- a/src/main/java/com/github/dockerjava/api/command/InspectContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/InspectContainerCmd.java
@@ -11,6 +11,7 @@ public interface InspectContainerCmd extends DockerCmd<InspectContainerResponse>
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public InspectContainerResponse exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<InspectContainerCmd, InspectContainerResponse> {
diff --git a/src/main/java/com/github/dockerjava/api/command/InspectImageCmd.java b/src/main/java/com/github/dockerjava/api/command/InspectImageCmd.java
index f2523487..d064badb 100644
--- a/src/main/java/com/github/dockerjava/api/command/InspectImageCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/InspectImageCmd.java
@@ -14,6 +14,7 @@ public interface InspectImageCmd extends DockerCmd<InspectImageResponse>{
 	/**
 	 * @throws NotFoundException No such image
 	 */
+	@Override
 	public InspectImageResponse exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<InspectImageCmd, InspectImageResponse> {
diff --git a/src/main/java/com/github/dockerjava/api/command/KillContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/KillContainerCmd.java
index aff39f9e..b9522cb8 100644
--- a/src/main/java/com/github/dockerjava/api/command/KillContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/KillContainerCmd.java
@@ -18,6 +18,7 @@ public interface KillContainerCmd extends DockerCmd<Void> {
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public Void exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<KillContainerCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/command/LogContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/LogContainerCmd.java
index e0f20f9a..36a41beb 100644
--- a/src/main/java/com/github/dockerjava/api/command/LogContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/LogContainerCmd.java
@@ -58,6 +58,7 @@ public interface LogContainerCmd extends DockerCmd<InputStream>{
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public InputStream exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<LogContainerCmd, InputStream> {
diff --git a/src/main/java/com/github/dockerjava/api/command/PauseContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/PauseContainerCmd.java
index a05733f9..652d433e 100644
--- a/src/main/java/com/github/dockerjava/api/command/PauseContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/PauseContainerCmd.java
@@ -17,6 +17,7 @@ public interface PauseContainerCmd extends DockerCmd<Void>{
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public Void exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<PauseContainerCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/command/PushImageCmd.java b/src/main/java/com/github/dockerjava/api/command/PushImageCmd.java
index c746fd7c..f50beb01 100644
--- a/src/main/java/com/github/dockerjava/api/command/PushImageCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/PushImageCmd.java
@@ -33,6 +33,7 @@ public interface PushImageCmd extends DockerCmd<InputStream>{
 	/**
 	 * @throws NotFoundException No such image
 	 */
+	@Override
 	public InputStream exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<PushImageCmd, InputStream> {
diff --git a/src/main/java/com/github/dockerjava/api/command/RemoveContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/RemoveContainerCmd.java
index be9b9d25..b9c1f943 100644
--- a/src/main/java/com/github/dockerjava/api/command/RemoveContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/RemoveContainerCmd.java
@@ -27,6 +27,7 @@ public interface RemoveContainerCmd extends DockerCmd<Void> {
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public Void exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<RemoveContainerCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/command/RemoveImageCmd.java b/src/main/java/com/github/dockerjava/api/command/RemoveImageCmd.java
index 212c9290..be65ca41 100644
--- a/src/main/java/com/github/dockerjava/api/command/RemoveImageCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/RemoveImageCmd.java
@@ -41,6 +41,7 @@ public interface RemoveImageCmd extends DockerCmd<Void>{
 	/**
 	 * @throws NotFoundException No such image
 	 */
+	@Override
 	public Void exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<RemoveImageCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/command/RestartContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/RestartContainerCmd.java
index 793919c2..8da41d38 100644
--- a/src/main/java/com/github/dockerjava/api/command/RestartContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/RestartContainerCmd.java
@@ -21,6 +21,7 @@ public interface RestartContainerCmd extends DockerCmd<Void> {
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public Void exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<RestartContainerCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/command/StartContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/StartContainerCmd.java
index ef96267f..40fb23a9 100644
--- a/src/main/java/com/github/dockerjava/api/command/StartContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/StartContainerCmd.java
@@ -135,6 +135,7 @@ public interface StartContainerCmd extends DockerCmd<Void> {
 	 * @throws NotModifiedException
 	 *             Container already started
 	 */
+	@Override
 	public Void exec() throws NotFoundException, NotModifiedException;
 
 	public static interface Exec extends DockerCmdExec<StartContainerCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/command/StopContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/StopContainerCmd.java
index 7e706c06..19c24855 100644
--- a/src/main/java/com/github/dockerjava/api/command/StopContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/StopContainerCmd.java
@@ -24,6 +24,7 @@ public interface StopContainerCmd extends DockerCmd<Void> {
 	 * @throws NotFoundException No such container
 	 * @throws NotModifiedException Container already stopped
 	 */
+	@Override
 	public Void exec() throws NotFoundException, NotModifiedException;
 	
 	public static interface Exec extends DockerCmdExec<StopContainerCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/command/TopContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/TopContainerCmd.java
index c7818a79..63865c2a 100644
--- a/src/main/java/com/github/dockerjava/api/command/TopContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/TopContainerCmd.java
@@ -18,6 +18,7 @@ public interface TopContainerCmd extends DockerCmd<TopContainerResponse> {
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public TopContainerResponse exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<TopContainerCmd, TopContainerResponse> {
diff --git a/src/main/java/com/github/dockerjava/api/command/UnpauseContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/UnpauseContainerCmd.java
index e74df14c..166bfa6a 100644
--- a/src/main/java/com/github/dockerjava/api/command/UnpauseContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/UnpauseContainerCmd.java
@@ -17,6 +17,7 @@ public interface UnpauseContainerCmd extends DockerCmd<Void> {
 	/**
 	 * @throws NotFoundException No such container
 	 */
+	@Override
 	public Void exec() throws NotFoundException;
 	
 	public static interface Exec extends DockerCmdExec<UnpauseContainerCmd, Void> {
diff --git a/src/main/java/com/github/dockerjava/api/model/AccessMode.java b/src/main/java/com/github/dockerjava/api/model/AccessMode.java
index a1f53f57..e0106536 100644
--- a/src/main/java/com/github/dockerjava/api/model/AccessMode.java
+++ b/src/main/java/com/github/dockerjava/api/model/AccessMode.java
@@ -16,5 +16,4 @@ public enum AccessMode {
 	 */
 	public static final AccessMode DEFAULT = rw;
 
-	
 }
diff --git a/src/main/java/com/github/dockerjava/api/model/Bind.java b/src/main/java/com/github/dockerjava/api/model/Bind.java
index eb0b8fd4..2a838c27 100644
--- a/src/main/java/com/github/dockerjava/api/model/Bind.java
+++ b/src/main/java/com/github/dockerjava/api/model/Bind.java
@@ -1,6 +1,7 @@
 package com.github.dockerjava.api.model;
 
-
+import static com.github.dockerjava.api.model.AccessMode.ro;
+import static com.github.dockerjava.api.model.AccessMode.rw;
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
@@ -28,6 +29,14 @@ public class Bind {
 		this.accessMode = accessMode;
 	}
 
+	/**
+	 * @deprecated use {@link #Bind(String, Volume, AccessMode)}
+	 */
+	@Deprecated
+	public Bind(String path, Volume volume, boolean readOnly) {
+		this(path, volume, readOnly ? ro : rw);
+	}
+
 	public String getPath() {
 		return path;
 	}
@@ -40,6 +49,13 @@ public class Bind {
 		return accessMode;
 	}
 
+	/**
+	 * @deprecated use {@link #getAccessMode()}
+	 */
+	@Deprecated
+	public boolean isReadOnly() {
+		return ro.equals(accessMode);
+	}
 
 	/**
 	 * Parses a bind mount specification to a {@link Bind}.
diff --git a/src/main/java/com/github/dockerjava/api/model/HostConfig.java b/src/main/java/com/github/dockerjava/api/model/HostConfig.java
index 5532fba3..3d186501 100644
--- a/src/main/java/com/github/dockerjava/api/model/HostConfig.java
+++ b/src/main/java/com/github/dockerjava/api/model/HostConfig.java
@@ -33,7 +33,7 @@ public class HostConfig {
 	private String[] dnsSearch;
 
 	@JsonProperty("VolumesFrom")
-	private VolumesFrom[] volumesFrom;
+	private String[] volumesFrom;
 
 	@JsonProperty("ContainerIDFile")
 	private String containerIDFile;
@@ -57,7 +57,7 @@ public class HostConfig {
 	}
 
 	public HostConfig(String[] binds, Links links, LxcConf[] lxcConf, Ports portBindings, boolean publishAllPorts,
-			boolean privileged, String[] dns, String[] dnsSearch, VolumesFrom[] volumesFrom, String containerIDFile,
+			boolean privileged, String[] dns, String[] dnsSearch, String[] volumesFrom, String containerIDFile,
 			Capability[] capAdd, Capability[] capDrop, RestartPolicy restartPolicy, String networkMode, Device[] devices) {
 		this.binds = binds;
 		this.links = links;
@@ -100,7 +100,7 @@ public class HostConfig {
 		return dns;
 	}
 
-	public VolumesFrom[] getVolumesFrom() {
+	public String[] getVolumesFrom() {
 		return volumesFrom;
 	}
 
@@ -168,7 +168,7 @@ public class HostConfig {
 		this.dnsSearch = dnsSearch;
 	}
 
-	public void setVolumesFrom(VolumesFrom[] volumesFrom) {
+	public void setVolumesFrom(String[] volumesFrom) {
 		this.volumesFrom = volumesFrom;
 	}
 
diff --git a/src/main/java/com/github/dockerjava/api/model/Links.java b/src/main/java/com/github/dockerjava/api/model/Links.java
index d901ea8d..9bbef25d 100644
--- a/src/main/java/com/github/dockerjava/api/model/Links.java
+++ b/src/main/java/com/github/dockerjava/api/model/Links.java
@@ -5,7 +5,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.core.JsonParser;
diff --git a/src/main/java/com/github/dockerjava/api/model/Volume.java b/src/main/java/com/github/dockerjava/api/model/Volume.java
index 3ec5e24c..1a189014 100644
--- a/src/main/java/com/github/dockerjava/api/model/Volume.java
+++ b/src/main/java/com/github/dockerjava/api/model/Volume.java
@@ -30,23 +30,18 @@ public class Volume {
 
 	private String path;
 	
-	private AccessMode accessMode = AccessMode.rw;
+	private boolean readWrite = true;
 
 	public Volume(String path) {
 		this.path = path;
 	}
-	
-	public Volume(String path, AccessMode accessMode) {
-		this.path = path;
-		this.accessMode = accessMode;
-	}
 
 	public String getPath() {
 		return path;
 	}
 	
-	public AccessMode getAccessMode() {
-		return accessMode;
+	public boolean isReadWrite() {
+		return readWrite;
 	}
 
 	public static Volume parse(String serialized) {
@@ -69,7 +64,7 @@ public class Volume {
 	public boolean equals(Object obj) {
 		if (obj instanceof Volume) {
 			Volume other = (Volume) obj;
-			return new EqualsBuilder().append(path, other.getPath()).append(accessMode, other.getAccessMode())
+			return new EqualsBuilder().append(path, other.getPath()).append(readWrite, other.isReadWrite())
 					.isEquals();
 		} else
 			return super.equals(obj);
@@ -77,7 +72,7 @@ public class Volume {
 
 	@Override
 	public int hashCode() {
-		return new HashCodeBuilder().append(path).append(accessMode).toHashCode();
+		return new HashCodeBuilder().append(path).append(readWrite).toHashCode();
 	}
 	
 	public static class Serializer extends JsonSerializer<Volume> {
@@ -89,7 +84,7 @@ public class Volume {
 
 			jsonGen.writeStartObject();
 			jsonGen.writeFieldName(volume.getPath());
-			jsonGen.writeString(Boolean.toString(volume.getAccessMode().equals(AccessMode.rw) ? true: false));
+			jsonGen.writeString(Boolean.toString(volume.isReadWrite()));
 			jsonGen.writeEndObject();
 		}
 
diff --git a/src/main/java/com/github/dockerjava/api/model/Volumes.java b/src/main/java/com/github/dockerjava/api/model/Volumes.java
index 69753d6a..b8a9315b 100644
--- a/src/main/java/com/github/dockerjava/api/model/Volumes.java
+++ b/src/main/java/com/github/dockerjava/api/model/Volumes.java
@@ -48,7 +48,7 @@ public class Volumes {
 			jsonGen.writeStartObject();
 			for (Volume volume : volumes.getVolumes()) {
 				jsonGen.writeFieldName(volume.getPath());
-				jsonGen.writeString(Boolean.toString(volume.getAccessMode().equals(AccessMode.rw) ? true: false));
+				jsonGen.writeString(Boolean.toString(volume.isReadWrite()));
 			}
 			jsonGen.writeEndObject();
 		}
diff --git a/src/main/java/com/github/dockerjava/api/model/VolumesFrom.java b/src/main/java/com/github/dockerjava/api/model/VolumesFrom.java
deleted file mode 100644
index 9aae9f30..00000000
--- a/src/main/java/com/github/dockerjava/api/model/VolumesFrom.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.github.dockerjava.api.model;
-
-import java.io.IOException;
-
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-@JsonSerialize(using = VolumesFrom.Serializer.class)
-@JsonDeserialize(using = VolumesFrom.Deserializer.class)
-public class VolumesFrom {
-
-	private String container;
-
-	private AccessMode accessMode;
-
-	public VolumesFrom(String container) {
-		this(container, AccessMode.DEFAULT);
-	}
-
-	public VolumesFrom(String container, AccessMode accessMode) {
-		this.container = container;
-		this.accessMode = accessMode;
-	}
-	
-	public String getContainer() {
-		return container;
-	}
-	
-	public AccessMode getAccessMode() {
-		return accessMode;
-	}
-
-
-	/**
-	 * Parses a volume from specification to a {@link VolumesFrom}.
-	 * 
-	 * @param serialized the specification, e.g. <code>container:ro</code>
-	 * @return a {@link VolumesFrom} matching the specification
-	 * @throws IllegalArgumentException if the specification cannot be parsed
-	 */
-	public static VolumesFrom parse(String serialized) {
-		try {
-			String[] parts = serialized.split(":");
-			switch (parts.length) {
-			case 1: {
-				return new VolumesFrom(parts[0]);
-			}
-			case 2: {
-				return new VolumesFrom(parts[0], AccessMode.valueOf(parts[1]));
-			}
-			
-			default: {
-				throw new IllegalArgumentException();
-			}
-			}
-		} catch (Exception e) {
-			throw new IllegalArgumentException("Error parsing Bind '" + serialized
-					+ "'");
-		}
-	}
-
-	@Override
-	public boolean equals(Object obj) {
-		if (obj instanceof VolumesFrom) {
-			VolumesFrom other = (VolumesFrom) obj;
-			return new EqualsBuilder().append(container, other.getContainer())
-					.append(accessMode, other.getAccessMode()).isEquals();
-		} else
-			return super.equals(obj);
-	}
-
-	@Override
-	public int hashCode() {
-		return new HashCodeBuilder().append(container)
-				.append(accessMode).toHashCode();
-	}
-
-	/**
-	 * Returns a string representation of this {@link VolumesFrom} suitable
-	 * for inclusion in a JSON message.
-	 * The format is <code>&lt;container&gt;:&lt;access mode&gt;</code>,
-	 * like the argument in {@link #parse(String)}.
-	 * 
-	 * @return a string representation of this {@link VolumesFrom}
-	 */
-	@Override
-	public String toString() {
-		return container + ":" + accessMode.toString();
-	}
-	
-	public static class Serializer extends JsonSerializer<VolumesFrom> {
-
-		@Override
-		public void serialize(VolumesFrom volumeFrom, JsonGenerator jsonGen,
-				SerializerProvider serProvider) throws IOException,
-				JsonProcessingException {
-
-			jsonGen.writeString(volumeFrom.toString());
-			
-		}
-
-	}
-
-	public static class Deserializer extends JsonDeserializer<VolumesFrom> {
-		@Override
-		public VolumesFrom deserialize(JsonParser jsonParser,
-				DeserializationContext deserializationContext)
-				throws IOException, JsonProcessingException {
-
-			ObjectCodec oc = jsonParser.getCodec();
-			JsonNode node = oc.readTree(jsonParser);
-			return VolumesFrom.parse(node.asText());
-			
-		}
-	}
-
-}
diff --git a/src/main/java/com/github/dockerjava/core/command/CopyFileFromContainerCmdImpl.java b/src/main/java/com/github/dockerjava/core/command/CopyFileFromContainerCmdImpl.java
index 2d91bb72..fe1a57b6 100644
--- a/src/main/java/com/github/dockerjava/core/command/CopyFileFromContainerCmdImpl.java
+++ b/src/main/java/com/github/dockerjava/core/command/CopyFileFromContainerCmdImpl.java
@@ -84,18 +84,4 @@ public class CopyFileFromContainerCmdImpl extends AbstrDockerCmd<CopyFileFromCon
     public InputStream exec() throws NotFoundException {
     	return super.exec();
     }
-
-//	protected InputStream impl() throws DockerException {
-//
-//		CopyFileFromContainerCmd command = this;
-//		
-//		WebTarget webResource =
-//				baseResource.path("/containers/{id}/copy").resolveTemplate("id", command.getContainerId());
-//
-//		LOGGER.trace("POST: " + webResource.toString());
-//		
-//		return webResource.request().accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).post(entity(command, MediaType.APPLICATION_JSON), Response.class).readEntity(InputStream.class);		
-//	}
-
-
 }
diff --git a/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java b/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java
index 59a08b91..ea6d721e 100644
--- a/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java
+++ b/src/main/java/com/github/dockerjava/core/command/CreateContainerCmdImpl.java
@@ -15,9 +15,9 @@ import com.github.dockerjava.api.model.ExposedPort;
 import com.github.dockerjava.api.model.ExposedPorts;
 import com.github.dockerjava.api.model.HostConfig;
 import com.github.dockerjava.api.model.Volume;
-import com.github.dockerjava.api.model.VolumesFrom;
 import com.github.dockerjava.api.model.Volumes;
 
+
 /**
  *
  * Creates a new container.
@@ -303,12 +303,12 @@ public class CreateContainerCmdImpl extends AbstrDockerCmd<CreateContainerCmd, C
     }
 
     @Override
-	public VolumesFrom[] getVolumesFrom() {
+	public String[] getVolumesFrom() {
         return hostConfig.getVolumesFrom();
     }
 
     @Override
-	public CreateContainerCmdImpl withVolumesFrom(VolumesFrom... volumesFrom) {
+	public CreateContainerCmdImpl withVolumesFrom(String... volumesFrom) {
         this.hostConfig.setVolumesFrom(volumesFrom);
         return this;
     }
diff --git a/src/main/java/com/github/dockerjava/core/command/ExecCreateCmdImpl.java b/src/main/java/com/github/dockerjava/core/command/ExecCreateCmdImpl.java
index 219b789d..5819fa49 100644
--- a/src/main/java/com/github/dockerjava/core/command/ExecCreateCmdImpl.java
+++ b/src/main/java/com/github/dockerjava/core/command/ExecCreateCmdImpl.java
@@ -31,48 +31,58 @@ public class ExecCreateCmdImpl extends AbstrDockerCmd<ExecCreateCmd, ExecCreateC
         withContainerId(containerId);
     }
     
+    @Override
     public ExecCreateCmd withContainerId(String containerId) {
     	checkNotNull(containerId, "containerId was not specified");
         this.containerId = containerId;
         return this;
     }
 
+    @Override
     public ExecCreateCmd withAttachStdin(boolean attachStdin) {
         this.attachStdin = attachStdin;
         return this;
     }
     
+    @Override
     public ExecCreateCmd withAttachStdin() {
         return withAttachStdin(true);
     }
 
+    @Override
     public ExecCreateCmd withAttachStdout(boolean attachStdout) {
         this.attachStdout = attachStdout;
         return this;
     }
     
+    @Override
     public ExecCreateCmd withAttachStdout() {
         return withAttachStdout(true);
     }
 
+    @Override
     public ExecCreateCmd withAttachStderr(boolean attachStderr) {
         this.attachStderr = attachStderr;
         return this;
     }
     
+    @Override
     public ExecCreateCmd withAttachStderr() {
         return withAttachStderr(true);
     }
     
+    @Override
     public ExecCreateCmd withTty(boolean tty) {
         this.tty = tty;
         return this;
     }
     
+    @Override
     public ExecCreateCmd withTty() {
         return withTty(true);
     }
 
+    @Override
     public ExecCreateCmd withCmd(String... cmd) {
         this.cmd = cmd;
         return this;
diff --git a/src/main/java/com/github/dockerjava/jaxrs/AbstrDockerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/AbstrDockerCmdExec.java
index 4e63d8a4..95c13b26 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/AbstrDockerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/AbstrDockerCmdExec.java
@@ -39,6 +39,7 @@ public abstract class AbstrDockerCmdExec<CMD_T extends DockerCmd<RES_T>, RES_T>
 		}
 	}
 	
+	@Override
 	public RES_T exec(CMD_T command) {
 		// this hack works because of ResponseStatusExceptionFilter
 		RES_T result;
diff --git a/src/main/java/com/github/dockerjava/jaxrs/AttachContainerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/AttachContainerCmdExec.java
index 5ed84c34..1fafd1f0 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/AttachContainerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/AttachContainerCmdExec.java
@@ -1,7 +1,5 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import java.io.InputStream;
 
 import javax.ws.rs.client.WebTarget;
@@ -13,29 +11,34 @@ import org.slf4j.LoggerFactory;
 
 import com.github.dockerjava.api.command.AttachContainerCmd;
 
-public class AttachContainerCmdExec extends AbstrDockerCmdExec<AttachContainerCmd, InputStream> implements AttachContainerCmd.Exec {
-	
+public class AttachContainerCmdExec extends
+		AbstrDockerCmdExec<AttachContainerCmd, InputStream> implements
+		AttachContainerCmd.Exec {
+
 	private static final Logger LOGGER = LoggerFactory
 			.getLogger(AttachContainerCmdExec.class);
-	
+
 	public AttachContainerCmdExec(WebTarget baseResource) {
 		super(baseResource);
 	}
 
 	@Override
 	protected InputStream execute(AttachContainerCmd command) {
-		WebTarget webResource = getBaseResource().path("/containers/{id}/attach")
-                .resolveTemplate("id", command.getContainerId())
-                .queryParam("logs", command.hasLogsEnabled() ? "1" : "0")
-             // .queryParam("stdin", command.hasStdinEnabled() ? "1" : "0")
-                .queryParam("stdout", command.hasStdoutEnabled() ? "1" : "0")
-                .queryParam("stderr", command.hasStderrEnabled() ? "1" : "0")
-                .queryParam("stream", command.hasFollowStreamEnabled() ? "1" : "0");
+		WebTarget webResource = getBaseResource()
+				.path("/containers/{id}/attach")
+				.resolveTemplate("id", command.getContainerId())
+				.queryParam("logs", command.hasLogsEnabled() ? "1" : "0")
+				// .queryParam("stdin", command.hasStdinEnabled() ? "1" : "0")
+				.queryParam("stdout", command.hasStdoutEnabled() ? "1" : "0")
+				.queryParam("stderr", command.hasStderrEnabled() ? "1" : "0")
+				.queryParam("stream",
+						command.hasFollowStreamEnabled() ? "1" : "0");
 
 		LOGGER.trace("POST: {}", webResource);
-		
-		return webResource.request().accept(MediaType.APPLICATION_OCTET_STREAM_TYPE)
-				.post(entity(null, MediaType.APPLICATION_JSON), Response.class).readEntity(InputStream.class);
+
+		return webResource.request()
+				.accept(MediaType.APPLICATION_OCTET_STREAM_TYPE)
+				.post(null, Response.class).readEntity(InputStream.class);
 	}
 
 }
diff --git a/src/main/java/com/github/dockerjava/jaxrs/ExecCreateCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/ExecCreateCmdExec.java
index 69346efd..02ea4d8a 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/ExecCreateCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/ExecCreateCmdExec.java
@@ -25,6 +25,9 @@ public class ExecCreateCmdExec extends AbstrDockerCmdExec<ExecCreateCmd, ExecCre
 
         LOGGER.trace("POST: {}", webResource);
 
-        return webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(command, MediaType.APPLICATION_JSON), ExecCreateCmdResponse.class);
+		return webResource
+				.request()
+				.accept(MediaType.APPLICATION_JSON)
+				.post(entity(command, MediaType.APPLICATION_JSON), ExecCreateCmdResponse.class);
     }
 }
diff --git a/src/main/java/com/github/dockerjava/jaxrs/ExecStartCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/ExecStartCmdExec.java
index ae4c7181..effd3904 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/ExecStartCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/ExecStartCmdExec.java
@@ -26,6 +26,9 @@ public class ExecStartCmdExec extends AbstrDockerCmdExec<ExecStartCmd, InputStre
 
         LOGGER.trace("POST: {}", webResource);
 
-        return webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(command, MediaType.APPLICATION_JSON), Response.class).readEntity(InputStream.class);
+		return webResource
+				.request()
+				.accept(MediaType.APPLICATION_JSON)
+				.post(entity(command, MediaType.APPLICATION_JSON), Response.class).readEntity(InputStream.class);
     }
 }
diff --git a/src/main/java/com/github/dockerjava/jaxrs/KillContainerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/KillContainerCmdExec.java
index 28496edc..21a6b9d6 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/KillContainerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/KillContainerCmdExec.java
@@ -1,7 +1,5 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
@@ -10,25 +8,28 @@ import org.slf4j.LoggerFactory;
 
 import com.github.dockerjava.api.command.KillContainerCmd;
 
-public class KillContainerCmdExec extends AbstrDockerCmdExec<KillContainerCmd, Void> implements KillContainerCmd.Exec {
-	
+public class KillContainerCmdExec extends
+		AbstrDockerCmdExec<KillContainerCmd, Void> implements
+		KillContainerCmd.Exec {
+
 	private static final Logger LOGGER = LoggerFactory
 			.getLogger(KillContainerCmdExec.class);
-	
+
 	public KillContainerCmdExec(WebTarget baseResource) {
 		super(baseResource);
 	}
 
 	@Override
 	protected Void execute(KillContainerCmd command) {
-		WebTarget webResource = getBaseResource().path("/containers/{id}/kill").resolveTemplate("id", command.getContainerId());
+		WebTarget webResource = getBaseResource().path("/containers/{id}/kill")
+				.resolveTemplate("id", command.getContainerId());
 
-		if(command.getSignal() != null) {
+		if (command.getSignal() != null) {
 			webResource = webResource.queryParam("signal", command.getSignal());
 		}
-	
+
 		LOGGER.trace("POST: {}", webResource);
-		webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(null, MediaType.APPLICATION_JSON));	
+		webResource.request().accept(MediaType.APPLICATION_JSON).post(null);
 
 		return null;
 	}
diff --git a/src/main/java/com/github/dockerjava/jaxrs/PauseContainerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/PauseContainerCmdExec.java
index ee84a320..6b3eeaf0 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/PauseContainerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/PauseContainerCmdExec.java
@@ -1,19 +1,19 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.github.dockerjava.api.command.PauseContainerCmd;
 
-public class PauseContainerCmdExec extends AbstrDockerCmdExec<PauseContainerCmd, Void> implements PauseContainerCmd.Exec {
+public class PauseContainerCmdExec extends
+		AbstrDockerCmdExec<PauseContainerCmd, Void> implements
+		PauseContainerCmd.Exec {
 
-	private static final Logger LOGGER = LoggerFactory.getLogger(PauseContainerCmdExec.class);
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(PauseContainerCmdExec.class);
 
 	public PauseContainerCmdExec(WebTarget baseResource) {
 		super(baseResource);
@@ -21,13 +21,12 @@ public class PauseContainerCmdExec extends AbstrDockerCmdExec<PauseContainerCmd,
 
 	@Override
 	protected Void execute(PauseContainerCmd command) {
-		WebTarget webResource = getBaseResource().path("/containers/{id}/pause")
-				.resolveTemplate("id", command.getContainerId());
-		
+		WebTarget webResource = getBaseResource()
+				.path("/containers/{id}/pause").resolveTemplate("id",
+						command.getContainerId());
+
 		LOGGER.trace("POST: {}", webResource);
-		webResource.request()
-				.accept(MediaType.APPLICATION_JSON)
-				.post(entity(null, MediaType.APPLICATION_JSON), Response.class);
+		webResource.request().accept(MediaType.APPLICATION_JSON).post(null);
 
 		return null;
 	}
diff --git a/src/main/java/com/github/dockerjava/jaxrs/PullImageCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/PullImageCmdExec.java
index dea72f42..725483f8 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/PullImageCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/PullImageCmdExec.java
@@ -1,22 +1,24 @@
 package com.github.dockerjava.jaxrs;
 
-import com.github.dockerjava.api.command.PullImageCmd;
-import com.github.dockerjava.api.model.AuthConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.io.InputStream;
 
 import javax.ws.rs.client.Invocation;
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.InputStream;
 
-import static javax.ws.rs.client.Entity.entity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.github.dockerjava.api.command.PullImageCmd;
+import com.github.dockerjava.api.model.AuthConfig;
+
+public class PullImageCmdExec extends
+		AbstrDockerCmdExec<PullImageCmd, InputStream> implements
+		PullImageCmd.Exec {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(PullImageCmdExec.class);
 
-public class PullImageCmdExec extends AbstrDockerCmdExec<PullImageCmd, InputStream> implements PullImageCmd.Exec {
-	
-	private static final Logger LOGGER = LoggerFactory.getLogger(PullImageCmdExec.class);
-	
 	public PullImageCmdExec(WebTarget baseResource) {
 		super(baseResource);
 	}
@@ -24,22 +26,24 @@ public class PullImageCmdExec extends AbstrDockerCmdExec<PullImageCmd, InputStre
 	@Override
 	protected InputStream execute(PullImageCmd command) {
 		WebTarget webResource = getBaseResource().path("/images/create")
-                .queryParam("tag", command.getTag())
-                .queryParam("fromImage", command.getRepository())
-                .queryParam("registry", command.getRegistry());
+				.queryParam("tag", command.getTag())
+				.queryParam("fromImage", command.getRepository())
+				.queryParam("registry", command.getRegistry());
 
 		LOGGER.trace("POST: {}", webResource);
-        return resourceWithOptionalAuthConfig(command, webResource.request())
-				.accept(MediaType.APPLICATION_OCTET_STREAM_TYPE)
-				.post(entity(Response.class, MediaType.APPLICATION_JSON)).readEntity(InputStream.class);
+		return resourceWithOptionalAuthConfig(command, webResource.request())
+				.accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).post(null)
+				.readEntity(InputStream.class);
 	}
 
-    private Invocation.Builder resourceWithOptionalAuthConfig(PullImageCmd command, Invocation.Builder request) {
-        AuthConfig authConfig = command.getAuthConfig();
-        if (authConfig != null) {
-            request = request.header("X-Registry-Auth", registryAuth(authConfig));
-        }
-        return request;
-    }
+	private Invocation.Builder resourceWithOptionalAuthConfig(
+			PullImageCmd command, Invocation.Builder request) {
+		AuthConfig authConfig = command.getAuthConfig();
+		if (authConfig != null) {
+			request = request.header("X-Registry-Auth",
+					registryAuth(authConfig));
+		}
+		return request;
+	}
 
 }
diff --git a/src/main/java/com/github/dockerjava/jaxrs/PushImageCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/PushImageCmdExec.java
index 9454a0e7..b970d42f 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/PushImageCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/PushImageCmdExec.java
@@ -1,12 +1,9 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import java.io.InputStream;
 
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -14,28 +11,30 @@ import org.slf4j.LoggerFactory;
 import com.github.dockerjava.api.command.PushImageCmd;
 import com.github.dockerjava.api.model.AuthConfig;
 
-public class PushImageCmdExec extends AbstrDockerCmdExec<PushImageCmd, InputStream> implements PushImageCmd.Exec {
-	
-	private static final Logger LOGGER = LoggerFactory.getLogger(PushImageCmdExec.class);
-	
+public class PushImageCmdExec extends
+		AbstrDockerCmdExec<PushImageCmd, InputStream> implements
+		PushImageCmd.Exec {
+
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(PushImageCmdExec.class);
+
 	public PushImageCmdExec(WebTarget baseResource) {
 		super(baseResource);
 	}
 
 	@Override
 	protected InputStream execute(PushImageCmd command) {
-		WebTarget webResource = getBaseResource().path("/images/" + name(command) + "/push")
-		    .queryParam("tag", command.getTag());
+		WebTarget webResource = getBaseResource().path(
+				"/images/" + name(command) + "/push").queryParam("tag",
+				command.getTag());
 
 		final String registryAuth = registryAuth(command.getAuthConfig());
 		LOGGER.trace("POST: {}", webResource);
-		return webResource
-                .request()
-				.header("X-Registry-Auth", registryAuth)
-				.accept(MediaType.APPLICATION_JSON)
-				.post(entity(Response.class, MediaType.APPLICATION_JSON)).readEntity(InputStream.class);
+		return webResource.request().header("X-Registry-Auth", registryAuth)
+				.accept(MediaType.APPLICATION_JSON).post(null)
+				.readEntity(InputStream.class);
 	}
-	
+
 	private String name(PushImageCmd command) {
 		String name = command.getName();
 		AuthConfig authConfig = command.getAuthConfig();
diff --git a/src/main/java/com/github/dockerjava/jaxrs/RemoveImageCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/RemoveImageCmdExec.java
index 6bfeecd7..d5d7b800 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/RemoveImageCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/RemoveImageCmdExec.java
@@ -1,7 +1,6 @@
 package com.github.dockerjava.jaxrs;
 
 import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.Response;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/src/main/java/com/github/dockerjava/jaxrs/RestartContainerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/RestartContainerCmdExec.java
index fe544f13..b08aa032 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/RestartContainerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/RestartContainerCmdExec.java
@@ -1,7 +1,5 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
@@ -10,9 +8,12 @@ import org.slf4j.LoggerFactory;
 
 import com.github.dockerjava.api.command.RestartContainerCmd;
 
-public class RestartContainerCmdExec extends AbstrDockerCmdExec<RestartContainerCmd, Void> implements RestartContainerCmd.Exec {
+public class RestartContainerCmdExec extends
+		AbstrDockerCmdExec<RestartContainerCmd, Void> implements
+		RestartContainerCmd.Exec {
 
-	private static final Logger LOGGER = LoggerFactory.getLogger(RestartContainerCmdExec.class);
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(RestartContainerCmdExec.class);
 
 	public RestartContainerCmdExec(WebTarget baseResource) {
 		super(baseResource);
@@ -20,12 +21,13 @@ public class RestartContainerCmdExec extends AbstrDockerCmdExec<RestartContainer
 
 	@Override
 	protected Void execute(RestartContainerCmd command) {
-		WebTarget webResource = getBaseResource().path("/containers/{id}/restart")
+		WebTarget webResource = getBaseResource()
+				.path("/containers/{id}/restart")
 				.resolveTemplate("id", command.getContainerId())
 				.queryParam("t", String.valueOf(command.getTimeout()));
-		
+
 		LOGGER.trace("POST: {}", webResource);
-		webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(null, MediaType.APPLICATION_JSON_TYPE));
+		webResource.request().accept(MediaType.APPLICATION_JSON).post(null);
 
 		return null;
 	}
diff --git a/src/main/java/com/github/dockerjava/jaxrs/StopContainerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/StopContainerCmdExec.java
index 337c71b2..956f3d0b 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/StopContainerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/StopContainerCmdExec.java
@@ -1,7 +1,5 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
@@ -10,9 +8,12 @@ import org.slf4j.LoggerFactory;
 
 import com.github.dockerjava.api.command.StopContainerCmd;
 
-public class StopContainerCmdExec extends AbstrDockerCmdExec<StopContainerCmd, Void> implements StopContainerCmd.Exec {
+public class StopContainerCmdExec extends
+		AbstrDockerCmdExec<StopContainerCmd, Void> implements
+		StopContainerCmd.Exec {
 
-	private static final Logger LOGGER = LoggerFactory.getLogger(StopContainerCmdExec.class);
+	private static final Logger LOGGER = LoggerFactory
+			.getLogger(StopContainerCmdExec.class);
 
 	public StopContainerCmdExec(WebTarget baseResource) {
 		super(baseResource);
@@ -23,9 +24,9 @@ public class StopContainerCmdExec extends AbstrDockerCmdExec<StopContainerCmd, V
 		WebTarget webResource = getBaseResource().path("/containers/{id}/stop")
 				.resolveTemplate("id", command.getContainerId())
 				.queryParam("t", String.valueOf(command.getTimeout()));
-		
+
 		LOGGER.trace("POST: {}", webResource);
-		webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(null, MediaType.APPLICATION_JSON));
+		webResource.request().accept(MediaType.APPLICATION_JSON).post(null);
 
 		return null;
 	}
diff --git a/src/main/java/com/github/dockerjava/jaxrs/TagImageCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/TagImageCmdExec.java
index d8545e33..b1c770ba 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/TagImageCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/TagImageCmdExec.java
@@ -1,10 +1,6 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -28,7 +24,7 @@ public class TagImageCmdExec extends AbstrDockerCmdExec<TagImageCmd, Void> imple
                 .queryParam("force", command.hasForceEnabled() ? "1" : "0");
 
 		LOGGER.trace("POST: {}", webResource);
-		webResource.request().post(entity(null, MediaType.APPLICATION_JSON), Response.class);
+		webResource.request().post(null);
 		return null;
 	}
 	
diff --git a/src/main/java/com/github/dockerjava/jaxrs/WaitContainerCmdExec.java b/src/main/java/com/github/dockerjava/jaxrs/WaitContainerCmdExec.java
index e6f95586..1b81eee3 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/WaitContainerCmdExec.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/WaitContainerCmdExec.java
@@ -1,7 +1,5 @@
 package com.github.dockerjava.jaxrs;
 
-import static javax.ws.rs.client.Entity.entity;
-
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
@@ -27,7 +25,7 @@ public class WaitContainerCmdExec extends AbstrDockerCmdExec<WaitContainerCmd, I
 
 		LOGGER.trace("POST: {}", webResource);
 		ObjectNode ObjectNode = webResource.request().accept(MediaType.APPLICATION_JSON)
-				.post(entity(null, MediaType.TEXT_PLAIN), ObjectNode.class);
+				.post(null, ObjectNode.class);
 		
         return ObjectNode.get("StatusCode").asInt();
 	}
diff --git a/src/main/java/com/github/dockerjava/jaxrs/util/LoggingFilter.java b/src/main/java/com/github/dockerjava/jaxrs/util/LoggingFilter.java
new file mode 100644
index 00000000..9679f230
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/jaxrs/util/LoggingFilter.java
@@ -0,0 +1,330 @@
+package com.github.dockerjava.jaxrs.util;
+
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2011-2014 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License").  You
+ * may not use this file except in compliance with the License.  You can
+ * obtain a copy of the License at
+ * http://glassfish.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt.  See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license."  If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above.  However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URI;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Logger;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientRequestFilter;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerRequestFilter;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.container.PreMatching;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.WriterInterceptor;
+import javax.ws.rs.ext.WriterInterceptorContext;
+
+import javax.annotation.Priority;
+
+
+/**
+ * Universal logging filter.
+ *
+ * Can be used on client or server side. Has the highest priority.
+ *
+ * @author Pavel Bucek (pavel.bucek at oracle.com)
+ * @author Martin Matula (martin.matula at oracle.com)
+ */
+@PreMatching
+@Priority(Integer.MIN_VALUE)
+@SuppressWarnings("ClassWithMultipleLoggers")
+public class LoggingFilter implements ContainerRequestFilter, ClientRequestFilter, ContainerResponseFilter,
+        ClientResponseFilter, WriterInterceptor {
+
+    private static final Logger LOGGER = Logger.getLogger(LoggingFilter.class.getName());
+    private static final String NOTIFICATION_PREFIX = "* ";
+    private static final String REQUEST_PREFIX = "> ";
+    private static final String RESPONSE_PREFIX = "< ";
+    private static final String ENTITY_LOGGER_PROPERTY = LoggingFilter.class.getName() + ".entityLogger";
+
+    private static final Comparator<Map.Entry<String, List<String>>> COMPARATOR =
+            new Comparator<Map.Entry<String, List<String>>>() {
+
+                @Override
+                public int compare(final Map.Entry<String, List<String>> o1, final Map.Entry<String, List<String>> o2) {
+                    return o1.getKey().compareToIgnoreCase(o2.getKey());
+                }
+            };
+
+    private static final int DEFAULT_MAX_ENTITY_SIZE = 8 * 1024;
+
+    //
+    @SuppressWarnings("NonConstantLogger")
+    private final Logger logger;
+    private final AtomicLong _id = new AtomicLong(0);
+    private final boolean printEntity;
+    private final int maxEntitySize;
+
+    /**
+     * Create a logging filter logging the request and response to a default JDK
+     * logger, named as the fully qualified class name of this class. Entity
+     * logging is turned off by default.
+     */
+    public LoggingFilter() {
+        this(LOGGER, false);
+    }
+
+    /**
+     * Create a logging filter with custom logger and custom settings of entity
+     * logging.
+     *
+     * @param logger      the logger to log requests and responses.
+     * @param printEntity if true, entity will be logged as well up to the default maxEntitySize, which is 8KB
+     */
+    @SuppressWarnings("BooleanParameter")
+    public LoggingFilter(final Logger logger, final boolean printEntity) {
+        this.logger = logger;
+        this.printEntity = printEntity;
+        this.maxEntitySize = DEFAULT_MAX_ENTITY_SIZE;
+    }
+
+    /**
+     * Creates a logging filter with custom logger and entity logging turned on, but potentially limiting the size
+     * of entity to be buffered and logged.
+     *
+     * @param logger        the logger to log requests and responses.
+     * @param maxEntitySize maximum number of entity bytes to be logged (and buffered) - if the entity is larger,
+     *                      logging filter will print (and buffer in memory) only the specified number of bytes
+     *                      and print "...more..." string at the end.
+     */
+    public LoggingFilter(final Logger logger, final int maxEntitySize) {
+        this.logger = logger;
+        this.printEntity = true;
+        this.maxEntitySize = maxEntitySize;
+    }
+
+    private void log(final StringBuilder b) {
+        if (logger != null) {
+            logger.info(b.toString());
+        }
+    }
+
+    private StringBuilder prefixId(final StringBuilder b, final long id) {
+        b.append(Long.toString(id)).append(" ");
+        return b;
+    }
+
+    private void printRequestLine(final StringBuilder b, final String note, final long id, final String method, final URI uri) {
+        prefixId(b, id).append(NOTIFICATION_PREFIX)
+                .append(note)
+                .append(" on thread ").append(Thread.currentThread().getName())
+                .append("\n");
+        prefixId(b, id).append(REQUEST_PREFIX).append(method).append(" ").
+                append(uri.toASCIIString()).append("\n");
+    }
+
+    private void printResponseLine(final StringBuilder b, final String note, final long id, final int status) {
+        prefixId(b, id).append(NOTIFICATION_PREFIX)
+                .append(note)
+                .append(" on thread ").append(Thread.currentThread().getName()).append("\n");
+        prefixId(b, id).append(RESPONSE_PREFIX).
+                append(Integer.toString(status)).
+                append("\n");
+    }
+
+    private void printPrefixedHeaders(final StringBuilder b, final long id, final String prefix, final MultivaluedMap<String, String> headers) {
+        for (final Map.Entry<String, List<String>> headerEntry : getSortedHeaders(headers.entrySet())) {
+            final List<?> val = headerEntry.getValue();
+            final String header = headerEntry.getKey();
+
+            if (val.size() == 1) {
+                prefixId(b, id).append(prefix).append(header).append(": ").append(val.get(0)).append("\n");
+            } else {
+                final StringBuilder sb = new StringBuilder();
+                boolean add = false;
+                for (final Object s : val) {
+                    if (add) {
+                        sb.append(',');
+                    }
+                    add = true;
+                    sb.append(s);
+                }
+                prefixId(b, id).append(prefix).append(header).append(": ").append(sb.toString()).append("\n");
+            }
+        }
+    }
+
+    private Set<Map.Entry<String, List<String>>> getSortedHeaders(final Set<Map.Entry<String, List<String>>> headers) {
+        final TreeSet<Map.Entry<String, List<String>>> sortedHeaders = new TreeSet<Map.Entry<String, List<String>>>(COMPARATOR);
+        sortedHeaders.addAll(headers);
+        return sortedHeaders;
+    }
+
+    private InputStream logInboundEntity(final StringBuilder b, InputStream stream) throws IOException {
+        if (!stream.markSupported()) {
+            stream = new BufferedInputStream(stream);
+        }
+        stream.mark(maxEntitySize + 1);
+        final byte[] entity = new byte[maxEntitySize + 1];
+        final int entitySize = Math.max(0, stream.read(entity));
+        b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize)));
+        if (entitySize > maxEntitySize) {
+            b.append("...more...");
+        }
+        b.append('\n');
+        stream.reset();
+        return stream;
+    }
+
+    @Override
+    public void filter(final ClientRequestContext context) throws IOException {
+        final long id = this._id.incrementAndGet();
+        final StringBuilder b = new StringBuilder();
+
+        printRequestLine(b, "Sending client request", id, context.getMethod(), context.getUri());
+        printPrefixedHeaders(b, id, REQUEST_PREFIX, context.getStringHeaders());
+
+        if (printEntity && context.hasEntity()) {
+            final OutputStream stream = new LoggingStream(b, context.getEntityStream());
+            context.setEntityStream(stream);
+            context.setProperty(ENTITY_LOGGER_PROPERTY, stream);
+            // not calling log(b) here - it will be called by the interceptor
+        } else {
+            log(b);
+        }
+    }
+
+    @Override
+    public void filter(final ClientRequestContext requestContext, final ClientResponseContext responseContext) throws IOException {
+        final long id = this._id.incrementAndGet();
+        final StringBuilder b = new StringBuilder();
+
+        printResponseLine(b, "Client response received", id, responseContext.getStatus());
+        printPrefixedHeaders(b, id, RESPONSE_PREFIX, responseContext.getHeaders());
+
+        if (printEntity && responseContext.hasEntity()) {
+            responseContext.setEntityStream(logInboundEntity(b, responseContext.getEntityStream()));
+        }
+
+        log(b);
+    }
+
+    @Override
+    public void filter(final ContainerRequestContext context) throws IOException {
+        final long id = this._id.incrementAndGet();
+        final StringBuilder b = new StringBuilder();
+
+        printRequestLine(b, "Server has received a request", id, context.getMethod(), context.getUriInfo().getRequestUri());
+        printPrefixedHeaders(b, id, REQUEST_PREFIX, context.getHeaders());
+
+        if (printEntity && context.hasEntity()) {
+            context.setEntityStream(logInboundEntity(b, context.getEntityStream()));
+        }
+
+        log(b);
+    }
+
+    @Override
+    public void filter(final ContainerRequestContext requestContext, final ContainerResponseContext responseContext) throws IOException {
+        final long id = this._id.incrementAndGet();
+        final StringBuilder b = new StringBuilder();
+
+        printResponseLine(b, "Server responded with a response", id, responseContext.getStatus());
+        printPrefixedHeaders(b, id, RESPONSE_PREFIX, responseContext.getStringHeaders());
+
+        if (printEntity && responseContext.hasEntity()) {
+            final OutputStream stream = new LoggingStream(b, responseContext.getEntityStream());
+            responseContext.setEntityStream(stream);
+            requestContext.setProperty(ENTITY_LOGGER_PROPERTY, stream);
+            // not calling log(b) here - it will be called by the interceptor
+        } else {
+            log(b);
+        }
+    }
+
+    @Override
+    public void aroundWriteTo(final WriterInterceptorContext writerInterceptorContext) throws IOException, WebApplicationException {
+        final LoggingStream stream = (LoggingStream) writerInterceptorContext.getProperty(ENTITY_LOGGER_PROPERTY);
+        writerInterceptorContext.proceed();
+        if (stream != null) {
+            log(stream.getStringBuilder());
+        }
+    }
+
+    private class LoggingStream extends OutputStream {
+        private final StringBuilder b;
+        private final OutputStream inner;
+        private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+        LoggingStream(final StringBuilder b, final OutputStream inner) {
+            this.b = b;
+            this.inner = inner;
+        }
+
+        StringBuilder getStringBuilder() {
+            // write entity to the builder
+            final byte[] entity = baos.toByteArray();
+
+            b.append(new String(entity, 0, Math.min(entity.length, maxEntitySize)));
+            if (entity.length > maxEntitySize) {
+                b.append("...more...");
+            }
+            b.append('\n');
+
+            return b;
+        }
+
+        @Override
+        public void write(final int i) throws IOException {
+            if (baos.size() <= maxEntitySize) {
+                baos.write(i);
+            }
+            inner.write(i);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/com/github/dockerjava/jaxrs/util/SelectiveLoggingFilter.java b/src/main/java/com/github/dockerjava/jaxrs/util/SelectiveLoggingFilter.java
index 42898008..9c577fd5 100644
--- a/src/main/java/com/github/dockerjava/jaxrs/util/SelectiveLoggingFilter.java
+++ b/src/main/java/com/github/dockerjava/jaxrs/util/SelectiveLoggingFilter.java
@@ -10,7 +10,6 @@ import javax.ws.rs.client.ClientRequestContext;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 
-import org.glassfish.jersey.filter.LoggingFilter;
 
 /**
  * A version of the logging filter that will avoid trying to log entities which can cause


Test patch:
diff --git a/src/test/java/com/github/dockerjava/api/model/VolumeFrom_SerializingTest.java b/src/test/java/com/github/dockerjava/api/model/VolumeFrom_SerializingTest.java
deleted file mode 100644
index b7c3bbff..00000000
--- a/src/test/java/com/github/dockerjava/api/model/VolumeFrom_SerializingTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.github.dockerjava.api.model;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class VolumeFrom_SerializingTest {
-	private final ObjectMapper objectMapper = new ObjectMapper();
-	private final String json = "\"container1:ro\"";
-
-	@Test
-	public void deserializing() throws Exception {
-		VolumesFrom volumeFrom = objectMapper.readValue(json, VolumesFrom.class);
-		assertEquals(volumeFrom, new VolumesFrom("container1", AccessMode.ro));
-	}
-
-	@Test
-	public void serializing() throws Exception {
-		VolumesFrom volumeFrom = new VolumesFrom("container1", AccessMode.ro);
-		assertEquals(objectMapper.writeValueAsString(volumeFrom), json);
-	}
-
-}
diff --git a/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java b/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java
index ed81a529..2b879a9a 100644
--- a/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java
+++ b/src/test/java/com/github/dockerjava/core/command/CreateContainerCmdImplTest.java
@@ -32,7 +32,6 @@ import com.github.dockerjava.api.model.HostConfig;
 import com.github.dockerjava.api.model.Link;
 import com.github.dockerjava.api.model.Links;
 import com.github.dockerjava.api.model.Volume;
-import com.github.dockerjava.api.model.VolumesFrom;
 import com.github.dockerjava.client.AbstractDockerClientTest;
 
 @Test(groups = "integration")
@@ -126,14 +125,14 @@ public class CreateContainerCmdImplTest extends AbstractDockerClientTest {
 		// create a second container with volumes from first container
 		CreateContainerResponse container2 = dockerClient
 				.createContainerCmd("busybox").withCmd("sleep", "9999")
-				.withVolumesFrom(new VolumesFrom(container1Name)).exec();
+				.withVolumesFrom(container1Name).exec();
 		LOG.info("Created container2 {}", container2.toString());
 
 		InspectContainerResponse inspectContainerResponse2 = dockerClient
 				.inspectContainerCmd(container2.getId()).exec();
 
 		// No volumes are created, the information is just stored in .HostConfig.VolumesFrom
-		assertThat(inspectContainerResponse2.getHostConfig().getVolumesFrom(), hasItemInArray(new VolumesFrom(container1Name)));
+		assertThat(inspectContainerResponse2.getHostConfig().getVolumesFrom(), hasItemInArray(container1Name));
 
 		// To ensure that the information stored in VolumesFrom really is considered
 		// when starting the container, we start it and verify that it has the same 
@@ -145,7 +144,7 @@ public class CreateContainerCmdImplTest extends AbstractDockerClientTest {
 		
 		inspectContainerResponse2 = dockerClient.inspectContainerCmd(container2.getId()).exec();
 
-		assertThat(inspectContainerResponse2.getHostConfig().getVolumesFrom(), hasItemInArray(new VolumesFrom(container1Name)));
+		assertThat(inspectContainerResponse2.getHostConfig().getVolumesFrom(), hasItemInArray(container1Name));
 		assertContainerHasVolumes(inspectContainerResponse2, volume1, volume2);
 	}
 
diff --git a/src/test/java/com/github/dockerjava/core/command/WaitContainerCmdImplTest.java b/src/test/java/com/github/dockerjava/core/command/WaitContainerCmdImplTest.java
index 32434eea..19c7057d 100644
--- a/src/test/java/com/github/dockerjava/core/command/WaitContainerCmdImplTest.java
+++ b/src/test/java/com/github/dockerjava/core/command/WaitContainerCmdImplTest.java
@@ -16,7 +16,6 @@ import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 
 import com.github.dockerjava.api.DockerException;
-import com.github.dockerjava.api.InternalServerErrorException;
 import com.github.dockerjava.api.NotFoundException;
 import com.github.dockerjava.api.command.CreateContainerResponse;
 import com.github.dockerjava.api.command.InspectContainerResponse;