use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class ListTimezones method serve.
@Override
protected Response serve() {
String s = ParseTime.listTimezones();
JsonObject response = new JsonObject();
response.addProperty("tzlist", s);
return Response.done(response);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class LogAndEcho method serve.
@Override
protected Response serve() {
String s = _message.value();
Log.info(s);
JsonObject response = new JsonObject();
response.addProperty("message", s);
return Response.done(response);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class LogView method serve.
@Override
protected Response serve() {
String s = water.util.Log.getLogPathFileName();
JsonObject result = new JsonObject();
File f = new File(s);
String contents = Utils.readFile(f);
if (contents == null) {
contents = "Not yet initialized, please refresh...";
}
result.addProperty("log", "<pre>" + contents + "</pre>");
Response response = Response.done(result);
response.addHeader("<a class='btn btn-primary' href='LogDownload.html'>Download all logs</a>");
return response;
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class UniqueFrameId method toJSON.
public JsonObject toJSON() {
final String json = new String(writeJSON(new AutoBuffer()).buf());
if (json.length() == 0)
return new JsonObject();
JsonObject jo = (JsonObject) new JsonParser().parse(json);
jo.addProperty("id", this.getId());
return jo;
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class UniqueId method toJSON.
public JsonObject toJSON() {
JsonObject result = new JsonObject();
result.addProperty("key", this.getKey());
result.addProperty("creation_epoch_time_millis", this.getCreationEpochTimeMillis());
result.addProperty("id", this.getId());
return result;
}
Aggregations