BufferResponseWrapper wrapper = new BufferResponseWrapper(response);
try {
filterChain.doFilter(request, wrapper);
} catch (Exception e) {
throw new LoadResoruceException(e);
}
// 必须执行flush操作,否则可能取不到数据.
try {
wrapper.flush();
} catch (IOException e) {
throw new LoadResoruceException(e);
}
byte[] datas = wrapper.getDatas();
DefaultResource result = new DefaultResource(uri, datas);
result.setLastModified(getLastModified(uri));
return result;