public OS parseOS(String agentString) {
return osParser.parse(agentString);
}
private void initialize(InputStream regexYaml) {
Yaml yaml = new Yaml(new SafeConstructor());
@SuppressWarnings("unchecked")
Map<String,List<Map<String,String>>> regexConfig = (Map<String,List<Map<String,String>>>) yaml.load(regexYaml);
List<Map<String,String>> uaParserConfigs = regexConfig.get("user_agent_parsers");
if (uaParserConfigs == null) {
throw new IllegalArgumentException("user_agent_parsers is missing from yaml");
}