public class ImageName extends Object
Constructor and Description |
---|
ImageName(String fullName)
Create an image name
|
ImageName(String fullName,
String givenTag)
Create an image name with a tag.
|
Modifier and Type | Method and Description |
---|---|
String |
getFullName()
Get the full name of this image, including the registry and tag
(e.g.
|
String |
getFullName(String optionalRegistry)
Get the full name of this image like
getFullName(String) does, but allow
an optional registry. |
String |
getNameWithoutTag()
Get the full name of this image, including the registry but without
any tag (e.g.
|
String |
getNameWithoutTag(String optionalRegistry)
Get the full name of this image like
getNameWithoutTag() does, but allow
an optional registry. |
String |
getRegistry() |
String |
getRepository() |
String |
getSimpleName()
Get the simple name of the image, which is the repository sans the user parts.
|
String |
getTag() |
String |
getUser()
Get the user (or "project") part of the image name.
|
boolean |
hasRegistry() |
static void |
validate(String image)
Check whether the given name validates agains the Docker rules for names
|
public ImageName(String fullName)
fullName
- The fullname of the image in Docker format.public ImageName(String fullName, String givenTag)
fullName
- The fullname of the image in Docker format. IgivenTag
- tag to use. Can be null in which case the tag specified in fullName is used.public String getRepository()
public String getRegistry()
public String getTag()
public boolean hasRegistry()
public String getNameWithoutTag()
privateregistry:fabric8io/java
)public String getNameWithoutTag(String optionalRegistry)
getNameWithoutTag()
does, but allow
an optional registry. This registry is used when this image does not already
contain a registry.optionalRegistry
- optional registry to use when this image does not provide
a registry. Can be null in which case no optional registry is used*null
)public String getFullName()
privateregistry:fabric8io/java:7u53
)public String getFullName(String optionalRegistry)
getFullName(String)
does, but allow
an optional registry. This registry is used when this image does not already
contain a registry. If no tag was provided in the initial name, latest
is used.optionalRegistry
- optional registry to use when this image does not provide
a registry. Can be null in which case no optional registry is used*null
).public String getUser()
null
if no user is present in the namepublic String getSimpleName()
public static void validate(String image)
image
- image name to validate
d@throws IllegalArgumentException if the name doesnt validateCopyright © 2019. All rights reserved.