Permalink
Browse files

Formatting instead of concating while building methods.

  • Loading branch information...
1 parent 5e8bca8 commit 56cc8b8dfbcf6a8e464361795ccb75f38c3514d8 Andrew Kirilenko committed Mar 21, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 client/src/main/java/io/iron/ironworker/client/APIClient.java
@@ -244,11 +244,11 @@ private JsonObject parseResponseAsJson(HttpResponse response) throws APIExceptio
}
public JsonObject codesList(Map<String, String> params) throws APIException {
- return parseResponseAsJson(doRequest(new HttpGet(), "projects/" + projectId + "/codes", params));
+ return parseResponseAsJson(doRequest(new HttpGet(), String.format("projects/%s/codes", projectId), params));
}
public JsonObject codesGet(String id) throws APIException {
- return parseResponseAsJson(doRequest(new HttpGet(), "projects/" + projectId + "/codes/" + id, null));
+ return parseResponseAsJson(doRequest(new HttpGet(), String.format("projects/%s/codes/%s", projectId, id), null));
}
public JsonObject codesCreate(String name, String file, String runtime, String runner) throws APIException {
@@ -263,18 +263,18 @@ public JsonObject codesCreate(String name, String file, String runtime, String r
throw new APIException("File " + file + " not found", null);
}
- return parseResponseAsJson(doFileRequest(f, "projects/" + projectId + "/codes", params));
+ return parseResponseAsJson(doFileRequest(f, String.format("projects/%s/codes", projectId), params));
}
public JsonObject codesDelete(String id) throws APIException {
- return parseResponseAsJson(doRequest(new HttpDelete(), "projects/" + projectId + "/codes/" + id, null));
+ return parseResponseAsJson(doRequest(new HttpDelete(), String.format("projects/%s/codes/%s", projectId, id), null));
}
public JsonObject codesRevisions(String id, Map<String, String> params) throws APIException {
- return parseResponseAsJson(doRequest(new HttpGet(), "projects/" + projectId + "/codes/" + id + "/revisions", params));
+ return parseResponseAsJson(doRequest(new HttpGet(), String.format("projects/%s/codes/%s/revisions", projectId, id), params));
}
public byte[] codesDownload(String id, Map<String, String> params) throws APIException {
- return parseResponseAsByteArray(doRequest(new HttpGet(), "projects/" + projectId + "/codes/" + id + "/download", params));
+ return parseResponseAsByteArray(doRequest(new HttpGet(), String.format("projects/%s/codes/%s/download", projectId, id), params));
}
}

0 comments on commit 56cc8b8

Please sign in to comment.