Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface ListContainersCmd extends SyncDockerCmd<List<Container>> {
public Boolean hasShowSizeEnabled();

/**
* @param beforeId
* @param before
* - Show only containers created before Id, include non-running ones.
*/
public ListContainersCmd withBefore(String before);
Expand All @@ -44,7 +44,7 @@ public interface ListContainersCmd extends SyncDockerCmd<List<Container>> {
public ListContainersCmd withExitcodeFilter(Integer exitcode);

/**
* @param exitcode
* @param status
* - Show only containers with the passed status (created|restarting|running|paused|exited).
*/
public ListContainersCmd withStatusFilter(String status);
Expand Down Expand Up @@ -80,7 +80,7 @@ public interface ListContainersCmd extends SyncDockerCmd<List<Container>> {
public ListContainersCmd withShowSize(Boolean showSize);

/**
* @param sinceId
* @param since
* - Show only containers created since Id, include non-running ones.
*/
public ListContainersCmd withSince(String since);
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/com/github/dockerjava/core/DockerClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,11 @@ private static Properties overrideDockerPropertiesWithSettingsFromUserHome(Prope
Properties overriddenProperties = new Properties();
overriddenProperties.putAll(p);

final File usersDockerPropertiesFile = new File(systemProperties.getProperty("user.home"), "."
+ DOCKER_JAVA_PROPERTIES);
final File usersDockerPropertiesFile = new File(systemProperties.getProperty("user.home"),
"." + DOCKER_JAVA_PROPERTIES);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

placed filename on one line to not break my brain

if (usersDockerPropertiesFile.isFile()) {
try {
final FileInputStream in = new FileInputStream(usersDockerPropertiesFile);
try {
overriddenProperties.load(in);
} finally {
in.close();
}
try (FileInputStream in = new FileInputStream(usersDockerPropertiesFile)) {
overriddenProperties.load(in);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -381,6 +376,12 @@ public final DockerClientConfigBuilder withDockerHost(String dockerHost) {
return this;
}


public final DockerClientConfigBuilder withApiVersion(RemoteApiVersion apiVersion) {
this.apiVersion = apiVersion.getVersion();
return this;
}

public final DockerClientConfigBuilder withApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
return this;
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/com/github/dockerjava/core/RemoteApiVersion.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.github.dockerjava.core;

import java.io.Serializable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;

import java.io.Serializable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* Bean to encapsulate the version of the <a href="http://docs.docker.com/engine/reference/api/docker_remote_api/">Docker Remote (REST)
* API</a>
Expand Down Expand Up @@ -125,6 +125,13 @@ public boolean isGreaterOrEqual(final RemoteApiVersion other) {
return false;
}

/**
* @return String representation of version. i.e. "1.22"
*/
public String getVersion() {
return major + "." + minor;
}

// CHECKSTYLE:OFF
@Override
public boolean equals(final Object o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void afterMethod(ITestResult result) {
super.afterMethod(result);
}

@Test
public void testListContainers() throws Exception {

String testImage = "busybox";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void afterMethod(ITestResult result) {
super.afterMethod(result);
}

@Test
public void testListContainers() throws Exception {

String testImage = "busybox";
Expand Down