- public static Map<String, String> getQueryMap(String query) {
- String[] params = query.split("&");
- Map<String, String> map = new HashMap<>();
- for (String param : params) {
- String name = null;
- final String[] paramParts = param.split("=");
- try {
- name = URLDecoder.decode(paramParts[0], "utf-8");
- } catch (UnsupportedEncodingException e) {
- // Impossible
- }
- String value = null;
- try {
- value = URLDecoder.decode(paramParts[1], "utf-8");
- } catch (UnsupportedEncodingException e) {
- // Impossible
- }
- map.put(name, value);
- }
- return map;
- }
-
- public static String join(CharSequence separator, Iterable<? extends CharSequence> list) {
- StringBuilder buf = new StringBuilder();
- for (CharSequence str : list) {
- if (buf.length() > 0) {
- buf.append(separator);
- }
- buf.append(str);
- }
-
- return buf.toString();
+ public static GroupId decodeGroupId(String groupId) throws GroupIdFormatException {
+ return GroupId.fromBase64(groupId);