try {
gsDispatcher.handleRequest(req, resp);
} catch (Exception e) {
log.fine(e.getMessage());
throw new GeoWebCacheException(
"Problem communicating with GeoServer" + e.getMessage());
}
if (actualResponse != null) {
cookies = resp.getCachedCookies();
for (Cookie c : cookies) {
actualResponse.addCookie(c);
}
}
if (super.mimeStringCheck(expectedMimeType, resp.getContentType())) {
int responseCode = resp.getResponseCode();
tileRespRecv.setStatus(responseCode);
if (responseCode == 200) {
byte[] bytes = resp.getBytes();
try {
target.transferFrom(Channels
.newChannel(new ByteArrayInputStream(bytes)));
} catch (IOException e) {
throw new GeoWebCacheException(e);
}
Assert.isTrue(target.getSize() == bytes.length);
} else if (responseCode == 204) {
return;
} else {
throw new GeoWebCacheException(
"Unexpected response from GeoServer for request "
+ wmsParams + ", got response code "
+ responseCode);
}
} else {
log.severe("Unexpected response from GeoServer for request: "
+ wmsParams);
throw new GeoWebCacheException(
"Unexpected response from GeoServer for request "
+ wmsParams);
}
}