Search in sources :

Example 1 with RestResponse

use of com.jcabi.http.response.RestResponse in project jcabi-github by jcabi.

the class RtGitignores method iterate.

@Override
public Iterable<String> iterate() throws IOException {
    final RestResponse response = this.request.fetch().as(RestResponse.class).assertStatus(HttpURLConnection.HTTP_OK);
    final List<JsonString> list = response.as(JsonResponse.class).json().readArray().getValuesAs(JsonString.class);
    final List<String> templates = new ArrayList<String>(list.size());
    for (final JsonString value : list) {
        templates.add(value.getString());
    }
    return templates;
}
Also used : RestResponse(com.jcabi.http.response.RestResponse) ArrayList(java.util.ArrayList) JsonString(javax.json.JsonString) JsonString(javax.json.JsonString) JsonResponse(com.jcabi.http.response.JsonResponse)

Aggregations

JsonResponse (com.jcabi.http.response.JsonResponse)1 RestResponse (com.jcabi.http.response.RestResponse)1 ArrayList (java.util.ArrayList)1 JsonString (javax.json.JsonString)1