Skip to content
This repository was archived by the owner on Feb 1, 2018. It is now read-only.

Commit a17bfb2

Browse files
author
Marcus Linke
committed
not null check for withUri
1 parent 1436c7e commit a17bfb2

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/main/java/com/github/dockerjava/client/Config.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import java.net.URI;
77
import java.util.Properties;
88

9+
import com.google.common.base.Preconditions;
10+
911
public class Config {
1012
private final URI uri;
1113
private final String version, username, password, email;
@@ -95,7 +97,7 @@ public static Properties overrideDockerPropertiesWithSystemProperties(Properties
9597
overriddenProperties.putAll(p);
9698

9799
// TODO Add all values from system properties that begin with docker.io.*
98-
for (String s : new String[]{ "url", "version", "username", "password", "email"}) {
100+
for (String s : new String[]{ "url", "version", "username", "password", "email", "readTimeout", "enableLoggingFilter"}) {
99101
final String key = "docker.io." + s;
100102
if (System.getProperties().containsKey(key)) {
101103
overriddenProperties.setProperty(key, System.getProperty(key));
@@ -140,27 +142,28 @@ public DockerClientConfigBuilder withProperties(Properties p) {
140142
}
141143

142144
public final DockerClientConfigBuilder withUri(String uri) {
145+
Preconditions.checkNotNull(uri, "uri was not specified");
143146
this.uri = URI.create(uri);
144147
return this;
145148
}
146149
public final DockerClientConfigBuilder withVersion(String version) {
147-
this.version = version;
150+
this.version = version;
148151
return this;
149152
}
150153
public final DockerClientConfigBuilder withUsername(String username) {
151-
this.username = username;
154+
this.username = username;
152155
return this;
153156
}
154157
public final DockerClientConfigBuilder withPassword(String password) {
155-
this.password = password;
158+
this.password = password;
156159
return this;
157160
}
158161
public final DockerClientConfigBuilder withEmail(String email) {
159-
this.email = email;
162+
this.email = email;
160163
return this;
161164
}
162-
public final DockerClientConfigBuilder withReadTimeout(int readTimeout) {
163-
this.readTimeout = readTimeout;
165+
public final DockerClientConfigBuilder withReadTimeout(Integer readTimeout) {
166+
this.readTimeout = readTimeout;
164167
return this;
165168
}
166169
public final DockerClientConfigBuilder withLoggingFilter(boolean loggingFilterEnabled) {

0 commit comments

Comments
 (0)