public final class DeploymentPropertiesUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Map<String,String> |
convert(Properties properties)
Convert Properties to a Map with String keys and values.
|
static void |
ensureJustDeploymentProperties(Map<String,String> properties)
Ensure that deployment properties doesn't have keys not starting with either
app. or deployer. . |
static Map<String,String> |
extractAndQualifyDeployerProperties(Map<String,String> input,
String appName)
Retain only properties that are meant for the deployer of a given app
(those that start with
deployer.[appname] or deployer.* ) and
qualify all property values with the spring.cloud.deployer. prefix. |
static String |
format(Map<String,String> properties)
Returns a String representation of deployment properties as a comma separated list
of key=value pairs.
|
static Map<String,String> |
parse(String s)
Parses a String comprised of 0 or more comma-delimited key=value pairs where each
key has the format:
app.[appname].[key] or
deployer.[appname].[key] . |
static List<String> |
parseParams(List<String> params)
Parses a list of command line parameters and returns a list of parameters which
doesn't contain any special quoting either for values or whole parameter.
|
public static Map<String,String> parse(String s)
app.[appname].[key]
or
deployer.[appname].[key]
. Values may themselves contain commas, since the
split points will be based upon the key pattern.
Logic of parsing key/value pairs from a string is based on few rules and assumptions 1. keys will not have commas or equals. 2. First raw split is done by commas which will need to be fixed later if value is a comma-delimited list.
s
- the string to parsepublic static void ensureJustDeploymentProperties(Map<String,String> properties)
app.
or deployer.
. In case non supported key is found
IllegalArgumentException
is thrown.properties
- the properties to checkpublic static Map<String,String> extractAndQualifyDeployerProperties(Map<String,String> input, String appName)
deployer.[appname]
or deployer.*
) and
qualify all property values with the spring.cloud.deployer.
prefix.input
- the deplopyment propertiesappName
- the app namepublic static String format(Map<String,String> properties)
properties
- the properties to formatpublic static Map<String,String> convert(Properties properties)
properties
- the properties objectMap<String,String>
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.