Adjust getString to filter not set maven build parameters.

This commit is contained in:
asofold 2013-03-01 15:11:52 +01:00
parent 36b402c27a
commit 3b283b655c

View File

@ -31,9 +31,28 @@ public class BuildParameters {
// Auxiliary methods. // Auxiliary methods.
///////////////////// /////////////////////
/**
* This gets the raw mapping value, might be something like "${...}" in case the parameter has not been present during building.
* @param path
* @param preset
* @return
*/
public static String getMappingValue(String path, String preset){
String input = fileContents.get(path);
if (input == null) return preset;
else return input;
}
/**
* Get a string mapping value, excluding missing maven build parameters like '${...}'.
* @param path
* @param preset
* @return
*/
public static String getString(String path, String preset){ public static String getString(String path, String preset){
String input = fileContents.get(path); String input = fileContents.get(path);
if (input == null) return preset; if (input == null) return preset;
else if (input.startsWith("${") && input.endsWith("}")) return preset;
else return input; else return input;
} }