public class DockerCredentialHelper
extends java.lang.Object
Constructor and Description |
---|
DockerCredentialHelper(java.lang.String serverUrl,
java.nio.file.Path credentialHelper)
Constructs a new
DockerCredentialHelper . |
Modifier and Type | Method and Description |
---|---|
Credential |
retrieve()
Calls the credential helper CLI in the form:
|
public DockerCredentialHelper(java.lang.String serverUrl, java.nio.file.Path credentialHelper)
DockerCredentialHelper
.serverUrl
- the server URL to pass into the credential helpercredentialHelper
- the path to the credential helper executablepublic Credential retrieve() throws java.io.IOException, CredentialHelperUnhandledServerUrlException, CredentialHelperNotFoundException
echo -n <server URL> | docker-credential-<credential helper suffix> get
java.io.IOException
- if writing/reading process input/output failsCredentialHelperUnhandledServerUrlException
- if no credentials could be found for the
corresponding serverCredentialHelperNotFoundException
- if the credential helper CLI doesn't exist