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 String values.
|
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> |
parseArgumentList(String s,
String delimiter)
Parses a String comprised of 0 or more delimited key=value pairs where each key
has the format:
app.[appname].[key] or deployer.[appname].[key] . |
static Map<String,String> |
parseDeploymentProperties(String deploymentProperties,
File propertiesFile,
int which)
Parses a deployment properties conditionally either from properties
string or file which can be legacy properties file or yaml.
|
static List<String> |
parseParamList(String s,
String delimiter)
Parses a String comprised of 0 or more delimited key=value pairs where each key
has the format:
app.[appname].[key] or deployer.[appname].[key] . |
static Map<String,String> |
qualifyDeployerProperties(Map<String,String> input,
String appName)
Retain all 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 List<String> |
removeQuoting(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.
|
static void |
validateDeploymentProperties(Map<String,String> properties)
Ensure that deployment properties only have keys starting with
app. ,
deployer. or, spring.cloud.scheduler. . |
static void |
validateSkipperDeploymentProperties(Map<String,String> properties)
Ensure that deployment properties only have keys starting with
app. ,
deployer. or version. . |
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 List<String> parseParamList(String s, String delimiter)
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 parsedelimiter
- delimiter used to split the string into pairspublic static List<String> parseArgumentList(String s, String delimiter)
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 parsedelimiter
- delimiter used to split the string into pairspublic static Map<String,String> parseDeploymentProperties(String deploymentProperties, File propertiesFile, int which) throws IOException
deploymentProperties
- the deployment properties stringpropertiesFile
- the deployment properties filewhich
- the flag to choose between properties or fileIOException
- if file loading errorspublic static void validateDeploymentProperties(Map<String,String> properties)
app.
,
deployer.
or, spring.cloud.scheduler.
. In case non supported key is found IllegalArgumentException
is thrown.properties
- the properties to checkpublic static void validateSkipperDeploymentProperties(Map<String,String> properties)
app.
,
deployer.
or version.
. 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 Map<String,String> qualifyDeployerProperties(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 © 2024 Pivotal Software, Inc.. All rights reserved.