public Credential retrieve()
      throws IOException, CredentialHelperUnhandledServerUrlException,
          CredentialHelperNotFoundException {
    boolean isWindows =
        systemProperties.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows");
    String lowerCaseHelper = credentialHelper.toString().toLowerCase(Locale.ENGLISH);
    if (!isWindows || lowerCaseHelper.endsWith(".cmd") || lowerCaseHelper.endsWith(".exe")) {
      return retrieve(Arrays.asList(credentialHelper.toString(), "get"));
    }

    // We are on Windows with undefined/unknown file extension.
    for (String suffix : Arrays.asList(".cmd", ".exe")) {
      try {
        return retrieve(Arrays.asList(credentialHelper.toString() + suffix, "get"));
      } catch (CredentialHelperNotFoundException ignored) {
        // ignored
      }
    }
    // On Windows, launching a process from Java without a file extension should normally fail
    // (https://github.com/GoogleContainerTools/jib/issues/2399#issuecomment-612972912), but
    // running Jib on Linux-like environment (e.g., Cygwin) might succeed?
    return retrieve(Arrays.asList(credentialHelper.toString(), "get"));
  }
Calls the credential helper CLI.

<p>Calls occur in the form:

<pre>{@code
echo -n <server URL> | docker-credential-<credential helper suffix> get
}</pre>

@return the Docker credentials by calling the corresponding CLI
@throws IOException if writing/reading process input/output fails
@throws CredentialHelperUnhandledServerUrlException if no credentials could be found for the
    corresponding server
@throws CredentialHelperNotFoundException if the credential helper CLI doesn't exist
jib-core/src/main/java/com/google/cloud/tools/jib/registry/credentials/DockerCredentialHelper.java