|
6 | 6 | import java.net.URI; |
7 | 7 | import java.util.Properties; |
8 | 8 |
|
| 9 | +import com.google.common.base.Preconditions; |
| 10 | + |
9 | 11 | public class Config { |
10 | 12 | private final URI uri; |
11 | 13 | private final String version, username, password, email; |
@@ -95,7 +97,7 @@ public static Properties overrideDockerPropertiesWithSystemProperties(Properties |
95 | 97 | overriddenProperties.putAll(p); |
96 | 98 |
|
97 | 99 | // 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"}) { |
99 | 101 | final String key = "docker.io." + s; |
100 | 102 | if (System.getProperties().containsKey(key)) { |
101 | 103 | overriddenProperties.setProperty(key, System.getProperty(key)); |
@@ -140,27 +142,28 @@ public DockerClientConfigBuilder withProperties(Properties p) { |
140 | 142 | } |
141 | 143 |
|
142 | 144 | public final DockerClientConfigBuilder withUri(String uri) { |
| 145 | + Preconditions.checkNotNull(uri, "uri was not specified"); |
143 | 146 | this.uri = URI.create(uri); |
144 | 147 | return this; |
145 | 148 | } |
146 | 149 | public final DockerClientConfigBuilder withVersion(String version) { |
147 | | - this.version = version; |
| 150 | + this.version = version; |
148 | 151 | return this; |
149 | 152 | } |
150 | 153 | public final DockerClientConfigBuilder withUsername(String username) { |
151 | | - this.username = username; |
| 154 | + this.username = username; |
152 | 155 | return this; |
153 | 156 | } |
154 | 157 | public final DockerClientConfigBuilder withPassword(String password) { |
155 | | - this.password = password; |
| 158 | + this.password = password; |
156 | 159 | return this; |
157 | 160 | } |
158 | 161 | public final DockerClientConfigBuilder withEmail(String email) { |
159 | | - this.email = email; |
| 162 | + this.email = email; |
160 | 163 | return this; |
161 | 164 | } |
162 | | - public final DockerClientConfigBuilder withReadTimeout(int readTimeout) { |
163 | | - this.readTimeout = readTimeout; |
| 165 | + public final DockerClientConfigBuilder withReadTimeout(Integer readTimeout) { |
| 166 | + this.readTimeout = readTimeout; |
164 | 167 | return this; |
165 | 168 | } |
166 | 169 | public final DockerClientConfigBuilder withLoggingFilter(boolean loggingFilterEnabled) { |
|
0 commit comments