Implemented initial super client registration for user authentication.
Change-Id: I60a7396bef8c2f9b2c2e8bf1cb6e0d5018c79408
diff --git a/core/Changes b/core/Changes
index 1926b51..43d6a0b 100644
--- a/core/Changes
+++ b/core/Changes
@@ -3,6 +3,7 @@
- Added OAuth2 scopes: INSTALL_USER_CLIENT, UNINSTALL_USER_CLIENT
- Added status codes
- Implemented searching option using a network endpoint
+ - Updated JsonUtils
# version 0.67.1
diff --git a/core/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java b/core/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java
index b018688..792a6bb 100644
--- a/core/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java
+++ b/core/src/main/java/de/ids_mannheim/korap/utils/JsonUtils.java
@@ -2,6 +2,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -46,8 +47,7 @@
"Failed deserializing json object: " + json, json, e);
}
}
-
-
+
public static ObjectNode createObjectNode () {
return mapper.createObjectNode();
}
@@ -71,6 +71,10 @@
return mapper.readValue(json, cl);
}
+ public static <T> T read (InputStream is, Class<T> cl) throws IOException {
+ return mapper.readValue(is, cl);
+ }
+
public static <T> T readFile (String path, Class<T> clazz)
throws IOException {
@@ -78,7 +82,7 @@
}
- public static void writeFile (String path, String content)
+ public static void writeFile (String path, Object content)
throws IOException {
mapper.writeValue(new File(path), content);
}