public static Service parse(String header) { String[] parts = header.split(";"); Map<String, String> properties = new HashMap<String, String>(); if (parts.length > 1) { for (int i = 1 ; i < parts.length ; i++) { String[] keyvalue = parts[i].split("="); if (keyvalue.length == 2 && Strings.notEmpty(Strings.unquote(keyvalue[1]))) { properties.put(keyvalue[0], Strings.unquote(keyvalue[1])); } } } return new Service(parts[0], properties); }
public static Service parse(String header) { String[] parts = header.split(";"); Map<String, String> properties = new HashMap<String, String>(); if (parts.length > 1) { for (int i = 1 ; i < parts.length ; i++) { String[] keyvalue = parts[i].split("="); if (keyvalue.length == 2 && Strings.notEmpty(Strings.unquote(keyvalue[1]))) { properties.put(keyvalue[0], Strings.unquote(keyvalue[1])); } } } return new Service(parts[0], properties); }