org.springframework.cloud.dataflow.registry.support

## Class DockerImage

- java.lang.Object
- - org.springframework.cloud.dataflow.registry.support.DockerImage

-     public class DockerImage
      extends Object

  Docker image name parsing utility Code from https://github.com/vmware/admiral

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_NAMESPACE`
    `static String` | `DEFAULT_TAG`
    `static String` | `SECTION_SEPARATOR`
    `static String` | `TAG_SEPARATOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DockerImage()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DockerImage` | `fromImageName(String imageName)` parse a full image name (myhost:300/namespace/repo:tag) into its components
    `static DockerImage` | `fromParts(String hostPart, String namespacePart, String repoAndTagPart)`
    `static DockerImage` | `fromParts(String hostPart, String namespacePart, String repo, String tag)`
    `String` | `getHost()`
    `String` | `getNamespace()`
    `String` | `getNamespaceAndRepo()`
    `String` | `getRepository()`
    `String` | `getTag()`
    `boolean` | `isDockerHubImage()`
    `static boolean` | `isValidNamespace(String namespaceCandidate)` When a image name part can be ambiguously either host or namespace, check which one it is based on a regex of valid characters for the namespace part
    `String` | `toString()` Convert to a canonical string representation.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SECTION_SEPARATOR

          public static final String SECTION_SEPARATOR

      See Also:
        Constant Field Values

    - #### TAG_SEPARATOR

          public static final String TAG_SEPARATOR

      See Also:
        Constant Field Values

    - #### DEFAULT_NAMESPACE

          public static final String DEFAULT_NAMESPACE

      See Also:
        Constant Field Values

    - #### DEFAULT_TAG

          public static final String DEFAULT_TAG

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DockerImage

          public DockerImage()

  - ### Method Detail

    - #### fromImageName

          public static DockerImage fromImageName(String imageName)

      parse a full image name (myhost:300/namespace/repo:tag) into its components
      Parameters:
        `imageName` - the image name
      Returns:
        the corresponding DockerImage instance

    - #### fromParts

          public static DockerImage fromParts(String hostPart,
                                              String namespacePart,
                                              String repoAndTagPart)

    - #### fromParts

          public static DockerImage fromParts(String hostPart,
                                              String namespacePart,
                                              String repo,
                                              String tag)

    - #### isValidNamespace

          public static boolean isValidNamespace(String namespaceCandidate)

      When a image name part can be ambiguously either host or namespace, check which one it is based on a regex of valid characters for the namespace part
      Parameters:
        `namespaceCandidate` - candidate string for host or namespace
      Returns:
        true if namespace, false otherwise

    - #### getHost

          public String getHost()

      Returns:
        the host

    - #### getNamespace

          public String getNamespace()

      Returns:
        the namespace

    - #### getRepository

          public String getRepository()

      Returns:
        the repository

    - #### getNamespaceAndRepo

          public String getNamespaceAndRepo()

    - #### getTag

          public String getTag()

      Returns:
        the tag

    - #### isDockerHubImage

          public boolean isDockerHubImage()

    - #### toString

          public String toString()

      Convert to a canonical string representation. E.g.
      - from registry.hub.docker.com/library/alpine to alpine
      - from registry.hub.docker.com/mongons/mongo to mongons/mongo
      - from registry.local.corp/proj/image to registry.local.corp/proj/image
      Overrides:
        `toString` in class `Object`
      Returns:
        canonical string representation

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.