Prepared sync pipeline for content-based config sync
This commit is contained in:
parent
895b605523
commit
f80b55aa50
14 changed files with 242 additions and 90 deletions
|
@ -19,6 +19,8 @@ import java.io.FileWriter;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Reader;
|
||||
|
||||
public class JsonFactory {
|
||||
|
@ -103,6 +105,11 @@ public class JsonFactory {
|
|||
}
|
||||
}
|
||||
|
||||
public static void storeJson(OutputStream outStream, JsonElement jsonObject) {
|
||||
OutputStreamWriter writer = new OutputStreamWriter(outStream);
|
||||
GSON.toJson(jsonObject, writer);
|
||||
}
|
||||
|
||||
public static int getInt(JsonObject object, String member, int def) {
|
||||
JsonElement elem = object.get(member);
|
||||
return elem == null ? def : elem.getAsInt();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue