Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renames ImportImageCmd to CreateImageCmd
This renames the command class and related methods to match the method
name in the Docker Remote API.
https://docs.docker.com/reference/api/docker_remote_api_v1.13/#22-images
  • Loading branch information
mfulgo committed Jul 31, 2014
commit e904a40f2a486a92a0418b2e41dde3ecc0e8a39d
13 changes: 6 additions & 7 deletions src/main/java/com/github/dockerjava/client/DockerClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.github.dockerjava.client.command.ContainerDiffCmd;
import com.github.dockerjava.client.command.CopyFileFromContainerCmd;
import com.github.dockerjava.client.command.CreateContainerCmd;
import com.github.dockerjava.client.command.ImportImageCmd;
import com.github.dockerjava.client.command.CreateImageCmd;
import com.github.dockerjava.client.command.InfoCmd;
import com.github.dockerjava.client.command.InspectContainerCmd;
import com.github.dockerjava.client.command.InspectImageCmd;
Expand Down Expand Up @@ -63,7 +63,7 @@
public class DockerClient implements Closeable {

private Client client;

private final CommandFactory cmdFactory;
private final WebResource baseResource;
private AuthConfig authConfig;
Expand Down Expand Up @@ -96,7 +96,7 @@ public DockerClient(Config config, CommandFactory cmdFactory) {
ClientConfig clientConfig = new DefaultClientConfig();
client = new ApacheHttpClient4(new ApacheHttpClient4Handler(httpClient,
null, false), clientConfig);

if(config.getReadTimeout() != null) {
client.setReadTimeout(config.getReadTimeout());
}
Expand Down Expand Up @@ -195,7 +195,7 @@ public AuthCmd authCmd() {
public InfoCmd infoCmd() throws DockerException {
return cmdFactory.infoCmd().withBaseResource(baseResource);
}

public PingCmd pingCmd() {
return cmdFactory.pingCmd().withBaseResource(baseResource);
}
Expand All @@ -221,9 +221,8 @@ public PushImageCmd pushImageCmd(String name) {
// return execute(pushImageCmd(name));
// }

public ImportImageCmd importImageCmd(String repository,
InputStream imageStream) {
return cmdFactory.importImageCmd(repository, imageStream)
public CreateImageCmd createImageCmd(String repository, InputStream imageStream) {
return cmdFactory.createImageCmd(repository, imageStream)
.withBaseResource(baseResource);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface CommandFactory {
public ContainerDiffCmd containerDiffCmd(String containerId);
public CopyFileFromContainerCmd copyFileFromContainerCmd(String containerId, String resource);
public CreateContainerCmd createContainerCmd(String image);
public ImportImageCmd importImageCmd(String repository, InputStream imageStream);
public CreateImageCmd createImageCmd(String repository, InputStream imageStream);
public InfoCmd infoCmd();
public InspectContainerCmd inspectContainerCmd(String containerId);
public InspectImageCmd inspectImageCmd(String imageId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
/**
* Create an image by importing the given stream of a tar file.
*/
public class ImportImageCmd extends AbstrDockerCmd<ImportImageCmd, CreateImageResponse> {
public class CreateImageCmd extends AbstrDockerCmd<CreateImageCmd, CreateImageResponse> {

private static final Logger LOGGER = LoggerFactory.getLogger(ImportImageCmd.class);
private static final Logger LOGGER = LoggerFactory.getLogger(CreateImageCmd.class);

private String repository, tag;
private InputStream imageStream;
Expand All @@ -28,7 +28,7 @@ public class ImportImageCmd extends AbstrDockerCmd<ImportImageCmd, CreateImageRe
* @param repository the repository to import to
* @param imageStream the InputStream of the tar file
*/
public ImportImageCmd(String repository, InputStream imageStream) {
public CreateImageCmd(String repository, InputStream imageStream) {
withRepository(repository);
withImageStream(imageStream);
}
Expand All @@ -44,7 +44,7 @@ public String getTag() {
/**
* @param repository the repository to import to
*/
public ImportImageCmd withRepository(String repository) {
public CreateImageCmd withRepository(String repository) {
Preconditions.checkNotNull(repository, "repository was not specified");
this.repository = repository;
return this;
Expand All @@ -53,7 +53,7 @@ public ImportImageCmd withRepository(String repository) {
/**
* @param imageStream the InputStream of the tar file
*/
public ImportImageCmd withImageStream(InputStream imageStream) {
public CreateImageCmd withImageStream(InputStream imageStream) {
Preconditions
.checkNotNull(imageStream, "imageStream was not specified");
this.imageStream = imageStream;
Expand All @@ -63,7 +63,7 @@ public ImportImageCmd withImageStream(InputStream imageStream) {
/**
* @param tag any tag for this image
*/
public ImportImageCmd withTag(String tag) {
public CreateImageCmd withTag(String tag) {
Preconditions.checkNotNull(tag, "tag was not specified");
this.tag = tag;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public CreateContainerCmd createContainerCmd(String image) {
}

@Override
public ImportImageCmd importImageCmd(String repository, InputStream imageStream) {
return new ImportImageCmd(repository, imageStream);
public CreateImageCmd createImageCmd(String repository, InputStream imageStream) {
return new CreateImageCmd(repository, imageStream);
}

@Override
Expand Down Expand Up @@ -155,7 +155,7 @@ public VersionCmd versionCmd() {
public WaitContainerCmd waitContainerCmd(String containerId) {
return new WaitContainerCmd(containerId);
}

@Override
public PingCmd pingCmd() {
return new PingCmd();
Expand Down