@SuppressWarnings("unchecked")
List<Object> vals = (List<Object>) value;
try {
path = path.replaceAll("\\{(<[^>]+>)?" + key + "\\}", URLEncoder.encode(vals.get(0).toString().replace("$", "\\$"), "utf-8"));
} catch (UnsupportedEncodingException e) {
throw new RouteFileParsingException("RouteFile encoding exception", e);
}
} else {
try {
path = path.replaceAll("\\{(<[^>]+>)?" + key + "\\}", URLEncoder.encode(value.toString().replace("$", "\\$"), "utf-8"));
host = host.replaceAll("\\{(<[^>]+>)?" + key + "\\}", URLEncoder.encode(value.toString().replace("$", "\\$"), "utf-8"));
} catch (UnsupportedEncodingException e) {
throw new RouteFileParsingException("RouteFile encoding exception", e);
}
}
} else if (route.staticArgs.containsKey(key)) {
// Do nothing -> The key is static
} else if (value != null) {