示例#1
0
  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;
  }
示例#2
0
 private String getRemoteString(String queryURI) {
   return HttpOp.execHttpGetString(queryURI);
 }
示例#3
0
 private JsonValue httpGetJson(String url) {
   JsonResponseHandler x = new JsonResponseHandler();
   HttpOp.execHttpGet(url, WebContent.contentTypeJSON, x);
   return x.getJSON();
 }
示例#4
0
 @Override
 public TypedInputStream performOpen(String uri) {
   if (uri.startsWith("http://") || uri.startsWith("https://"))
     return HttpOp.execHttpGet(uri, WebContent.defaultGraphAcceptHeader);
   return null;
 }