fix #852 close ResponseData

This commit is contained in:
Shinsuke Sugaya 2017-01-26 16:28:37 +09:00
parent 40ecc18594
commit 62d0bbcb46

View file

@ -515,6 +515,10 @@ public class ViewHelper {
if (client == null) {
throw new FessSystemException("No CrawlerClient: " + configId + ", url: " + url);
}
return writeContent(configId, url, client);
}
protected StreamResponse writeContent(final String configId, final String url, final CrawlerClient client) {
final ResponseData responseData = client.execute(RequestDataBuilder.newRequestData().get().url(url).build());
final StreamResponse response = new StreamResponse(StringUtil.EMPTY);
writeFileName(response, responseData);
@ -531,6 +535,8 @@ public class ViewHelper {
if (!(e.getCause() instanceof ClientAbortException)) {
throw new FessSystemException("Failed to write a content. configId: " + configId + ", url: " + url, e);
}
} finally {
responseData.close();
}
if (logger.isDebugEnabled()) {
logger.debug("Finished to write " + url);