- public static File createTempFile() throws IOException {
- return File.createTempFile("signal_tmp_", ".tmp");
+ public static JsonNode getNotNullNode(JsonNode parent, String name) throws InvalidObjectException {
+ JsonNode node = parent.get(name);
+ if (node == null) {
+ throw new InvalidObjectException(String.format("Incorrect file format: expected parameter %s not found ", name));
+ }
+
+ return node;
+ }
+
+ public static byte[] decodeGroupId(String groupId) throws GroupIdFormatException {
+ try {
+ return Base64.decode(groupId);
+ } catch (IOException e) {
+ throw new GroupIdFormatException(groupId, e);
+ }