@Override public String body() { return this.response.body(); }
@Override public String body() { return Json.createReader(new StringReader(this.response.body())) .readObject().getJsonArray("items").toString(); } @Override
json.add("body", response.body()); if (file.getParentFile().mkdirs()) { Logger.debug(this, "directory created for %s", file);
InputStream content = null; try { String payload = response.body(); System.out.println("------ START ERROR PAYLOAD ------"); if (payload.startsWith("{")) {
@Override public String label() throws IOException { final long start = System.currentTimeMillis(); final String label = this.front("label") .uri().queryParam("name", this.lck).back() .method(Request.GET) .fetch() .body(); Logger.info( this, "label of \"%s\" retrieved in %[ms]s: \"%s\"", this.lck, System.currentTimeMillis() - start, label ); return label; }
@Override public boolean lock(final String label) throws IOException { final long start = System.currentTimeMillis(); final Response rsp = this.front("lock") .body().formParam("label", label) .formParam("name", this.lck).back() .method(Request.POST) .fetch(); final boolean locked = rsp.status() == HttpURLConnection.HTTP_SEE_OTHER; Logger.info( this, "lock of \"%s\" is %B in %[ms]s: %s", this.lck, locked, System.currentTimeMillis() - start, rsp.body() ); return locked; }
@Override public String check(final String name) throws IOException { return this.request.fetch() .as(XmlResponse.class) .rel("/page/links/link[@rel='check']/@href") .uri().queryParam("alias", name).back() .fetch() .body(); }