-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
189 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import | ||
echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust | ||
mvn -s .ci/settings.xml deploy -DskipTests -B -P release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.github.whileloop.rest4j; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.JsonElement; | ||
import com.google.gson.JsonParser; | ||
|
||
import java.io.InputStream; | ||
import java.io.Reader; | ||
import java.lang.reflect.Type; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
public class JsonUtils { | ||
static final Gson GSON = new Gson(); | ||
static final JsonParser PARSER = new JsonParser(); | ||
|
||
static JsonElement asJson(Reader reader) { | ||
return PARSER.parse(reader); | ||
} | ||
|
||
static <T> T asObject(Reader reader, Class<T> clazz) { | ||
return GSON.fromJson(reader, clazz); | ||
} | ||
|
||
static <T> T asObject(Reader reader, Type type) { | ||
return GSON.fromJson(reader, type); | ||
} | ||
|
||
static String is2String(InputStream is) { | ||
try (java.util.Scanner s = new java.util.Scanner(is, StandardCharsets.UTF_8.name())) { | ||
s.useDelimiter("\\A"); | ||
return s.hasNext() ? s.next() : ""; | ||
} | ||
} | ||
|
||
static String toJson(Object object) { | ||
return GSON.toJson(object); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.