private String execSleepTask(String name, int millis) { String url = urlRoot + "$/sleep"; if (name != null) { if (name.startsWith("/")) name = name.substring(1); url = url + "/" + name; } JsonResponseHandler x = new JsonResponseHandler(); HttpOp.execHttpPost(url + "?interval=" + millis, null, WebContent.contentTypeJSON, x); JsonValue v = x.getJSON(); String id = v.getAsObject().get("taskId").getAsString().value(); return id; }
private String getRemoteString(String queryURI) { return HttpOp.execHttpGetString(queryURI); }
private JsonValue httpGetJson(String url) { JsonResponseHandler x = new JsonResponseHandler(); HttpOp.execHttpGet(url, WebContent.contentTypeJSON, x); return x.getJSON(); }
@Override public TypedInputStream performOpen(String uri) { if (uri.startsWith("http://") || uri.startsWith("https://")) return HttpOp.execHttpGet(uri, WebContent.defaultGraphAcceptHeader); return null; }