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.String
AUTHS_ENTRY
private static java.lang.String
CREDS_STORE
private static org.slf4j.Logger
LOG
private static com.fasterxml.jackson.databind.ObjectMapper
MAPPER
-
Constructor Summary
Constructors Constructor Description DockerConfigReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.file.Path
defaultConfigPath()
private com.fasterxml.jackson.databind.node.ObjectNode
extractAuthJson(java.nio.file.Path configPath)
RegistryConfigs
fromConfig(java.nio.file.Path configPath)
Returns all RegistryConfig instances from the configuration file.RegistryAuth
fromConfig(java.nio.file.Path configPath, java.lang.String serverAddress)
Returns the RegistryAuth for the config file for the given registry server name.RegistryAuth
fromFirstConfig(java.nio.file.Path configPath)
Deprecated.do not use - only exists for backwards compatibility.private RegistryConfigs
parseDockerConfig(java.nio.file.Path configPath)
private RegistryAuth
parseDockerConfig(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
-
-