Package com.spotify.docker.client
Class DockerConfigReader
- java.lang.Object
-
- com.spotify.docker.client.DockerConfigReader
-
public class DockerConfigReader extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringAUTHS_ENTRYprivate static java.lang.StringCREDS_STOREprivate static org.slf4j.LoggerLOGprivate static com.fasterxml.jackson.databind.ObjectMapperMAPPER
-
Constructor Summary
Constructors Constructor Description DockerConfigReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.file.PathdefaultConfigPath()private com.fasterxml.jackson.databind.node.ObjectNodeextractAuthJson(java.nio.file.Path configPath)RegistryConfigsfromConfig(java.nio.file.Path configPath)Returns all RegistryConfig instances from the configuration file.RegistryAuthfromConfig(java.nio.file.Path configPath, java.lang.String serverAddress)Returns the RegistryAuth for the config file for the given registry server name.RegistryAuthfromFirstConfig(java.nio.file.Path configPath)Deprecated.do not use - only exists for backwards compatibility.private RegistryConfigsparseDockerConfig(java.nio.file.Path configPath)private RegistryAuthparseDockerConfig(java.nio.file.Path configPath, java.lang.String serverAddress)
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
MAPPER
private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
-
AUTHS_ENTRY
private static final java.lang.String AUTHS_ENTRY
- See Also:
- Constant Field Values
-
CREDS_STORE
private static final java.lang.String CREDS_STORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromConfig
public RegistryConfigs fromConfig(java.nio.file.Path configPath) throws java.io.IOException
Returns all RegistryConfig instances from the configuration file.- Throws:
java.io.IOException
-
fromConfig
public RegistryAuth fromConfig(java.nio.file.Path configPath, java.lang.String serverAddress) throws java.io.IOException
Returns the RegistryAuth for the config file for the given registry server name.- Throws:
java.lang.IllegalArgumentException- if the config file does not contain registry auth info for the registryjava.io.IOException
-
fromFirstConfig
@Deprecated public RegistryAuth fromFirstConfig(java.nio.file.Path configPath) throws java.io.IOException
Deprecated.do not use - only exists for backwards compatibility. UsefromConfig(Path)instead.- Throws:
java.io.IOException
-
parseDockerConfig
private RegistryAuth parseDockerConfig(java.nio.file.Path configPath, java.lang.String serverAddress) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDockerConfig
private RegistryConfigs parseDockerConfig(java.nio.file.Path configPath) throws java.io.IOException
- Throws:
java.io.IOException
-
defaultConfigPath
public java.nio.file.Path defaultConfigPath()
-
extractAuthJson
private com.fasterxml.jackson.databind.node.ObjectNode extractAuthJson(java.nio.file.Path configPath) throws java.io.IOException- Throws:
java.io.IOException
-
-