Package org.mandas.docker.client
Class DockerConfigReader
- java.lang.Object
-
- org.mandas.docker.client.DockerConfigReader
-
public class DockerConfigReader extends Object
-
-
Constructor Summary
Constructors Constructor Description DockerConfigReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistryAuth
anyRegistryAuth()
Return a single RegistryAuth from the default config file.RegistryConfigs
authForAllRegistries(Path configPath)
Parse the contents of the config file and generate all possibleRegistryAuth
s, which are bundled into aRegistryConfigs
instance.RegistryAuth
authForRegistry(Path configPath, String registry)
GenerateRegistryAuth
for the registry.Path
defaultConfigPath()
-
-
-
Method Detail
-
anyRegistryAuth
public RegistryAuth anyRegistryAuth() throws IOException
Return a single RegistryAuth from the default config file. If there is only one, it'll be that one.- Returns:
- Some registry auth value.
- Throws:
IOException
- when an error occured during reading for docker configuration
-
authForAllRegistries
public RegistryConfigs authForAllRegistries(Path configPath) throws IOException
Parse the contents of the config file and generate all possibleRegistryAuth
s, which are bundled into aRegistryConfigs
instance.- Parameters:
configPath
- Path to config file.- Returns:
- All registry auths that can be generated from the config file
- Throws:
IOException
- If the file cannot be read, or its JSON cannot be parsed
-
authForRegistry
public RegistryAuth authForRegistry(Path configPath, String registry) throws IOException
GenerateRegistryAuth
for the registry.- Parameters:
configPath
- Path to the docker config fileregistry
- Docker registry for which to generate auth- Returns:
- The generated authentication object
- Throws:
IOException
- when an error occured while reading the docker configuration
-
defaultConfigPath
public Path defaultConfigPath()
-
-