public class ConfigurationPropertyValidator extends Object
| Modifier and Type | Method and Description |
|---|---|
static ImageReference |
getGeneratedTargetDockerTag(String targetImage,
EventDispatcher eventDispatcher,
String generatedName,
String generatedTag,
HelpfulSuggestions helpfulSuggestions)
Returns an
ImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configured |
static Optional<Credential> |
getImageCredential(EventDispatcher eventDispatcher,
String usernameProperty,
String passwordProperty,
AuthProperty auth)
Gets a
Credential from a username and password. |
static List<String> |
parseListProperty(String property)
Parses a comma-separated string into a list.
|
static Map<String,String> |
parseMapProperty(String property)
Parses a string in the form of "key1=value1,key2=value2,..." into a map.
|
public static Optional<Credential> getImageCredential(EventDispatcher eventDispatcher, String usernameProperty, String passwordProperty, AuthProperty auth)
Credential from a username and password. First tries system properties, then
tries build configuration, otherwise returns null.eventDispatcher - the EventDispatcher used to dispatch log eventsusernameProperty - the name of the username system propertypasswordProperty - the name of the password system propertyauth - the configured credentialsAuthorization from the system properties or build configuration, or
Optional.empty() if neither is configured.public static ImageReference getGeneratedTargetDockerTag(@Nullable String targetImage, EventDispatcher eventDispatcher, String generatedName, String generatedTag, HelpfulSuggestions helpfulSuggestions) throws InvalidImageReferenceException
ImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configuredtargetImage - the configured target image referenceeventDispatcher - the EventDispatcher used to dispatch log eventsgeneratedName - the image name to use if targetImage is nullgeneratedTag - the tag to use if targetImage is nullhelpfulSuggestions - used for generating the message notifying the user of the generated
tagImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configuredInvalidImageReferenceException - if the configured or generated image reference is
invalidpublic static Map<String,String> parseMapProperty(String property)
property - the map string to parse, with entries separated by "," and key-value pairs
separated by "="Copyright © 2018. All rights reserved.