* @param response the specified Google App Engine HTTP response
* @return HTTP response
*/
private static HTTPResponse toHTTPResponse(
final com.google.appengine.api.urlfetch.HTTPResponse response) {
final HTTPResponse ret = new HTTPResponse();
ret.setContent(response.getContent());
ret.setFinalURL(response.getFinalUrl());
ret.setResponseCode(response.getResponseCode());
final List<com.google.appengine.api.urlfetch.HTTPHeader> gaeHTTPHeaders = response.getHeaders();
for (final com.google.appengine.api.urlfetch.HTTPHeader gaeHTTPHeader : gaeHTTPHeaders) {
final HTTPHeader header = new HTTPHeader(gaeHTTPHeader.getName(), gaeHTTPHeader.getValue());
ret.addHeader(header);
}
return ret;
}