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
1 parent
a51dc75
commit 46f3af5
Showing
1 changed file
with
24 additions
and
0 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,24 @@ | ||
package duckutil.jsonrpc; | ||
|
||
import net.minidev.json.parser.JSONParser; | ||
import net.minidev.json.JSONObject; | ||
import duckutil.ProcessRunner; | ||
import java.util.Collection; | ||
|
||
public class JsonProcessRunner extends ProcessRunner | ||
{ | ||
public JsonProcessRunner(Collection<String> cmd) | ||
throws Exception | ||
{ | ||
super(cmd); | ||
} | ||
|
||
public JSONObject getJsonOutput() | ||
throws Exception | ||
{ | ||
JSONParser parser = new JSONParser(JSONParser.MODE_STRICTEST); | ||
JSONObject json = (JSONObject)parser.parse(getOutput()); | ||
return json; | ||
} | ||
} | ||
|