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 RegistryAuthanyRegistryAuth()Return a single RegistryAuth from the default config file.RegistryConfigsauthForAllRegistries(Path configPath)Parse the contents of the config file and generate all possibleRegistryAuths, which are bundled into aRegistryConfigsinstance.RegistryAuthauthForRegistry(Path configPath, String registry)GenerateRegistryAuthfor the registry.PathdefaultConfigPath()
-
-
-
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 possibleRegistryAuths, which are bundled into aRegistryConfigsinstance.- 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
GenerateRegistryAuthfor 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()
-
-