Mercurial > hg > ismi-richfaces
view src/main/java/de/mpiwg/itgroup/diva/utils/JSONParam.java @ 210:0aa8975784d9
add deprecation notes to interface.
author | casties |
---|---|
date | Mon, 02 Sep 2019 13:14:08 +0200 |
parents | 2e911857a759 |
children |
line wrap: on
line source
package de.mpiwg.itgroup.diva.utils; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import org.json.JSONException; import org.json.JSONObject; public class JSONParam { private JSONObject json; public JSONParam(String string) throws WebApplicationException { try { json = new JSONObject(string); } catch (JSONException e) { throw new WebApplicationException(Response.status(Status.BAD_REQUEST) .entity("Couldn't parse JSON string: " + e.getMessage()) .build()); } } public JSONObject getObj() { return json; } }