use of org.hisp.dhis.system.SystemInfo in project dhis2-core by dhis2.
the class CharResponseWrapper method doFilter.
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
if (req != null && req instanceof HttpServletRequest && res != null && res instanceof HttpServletResponse) {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
PrintWriter writer = response.getWriter();
CharResponseWrapper responseWrapper = new CharResponseWrapper(response);
chain.doFilter(request, responseWrapper);
responseWrapper.setContentType("text/cache-manifest");
SystemInfo systemInfo = systemService.getSystemInfo();
writer.print(responseWrapper.toString());
writer.println("# DHIS2 " + systemInfo.getVersion() + " r" + systemInfo.getRevision());
writer.println("# User: " + currentUserService.getCurrentUsername());
writer.println("# User UI Language: " + localeManager.getCurrentLocale());
writer.println("# User DB Language: " + userSettingService.getUserSetting(UserSettingKey.DB_LOCALE));
writer.println("# Calendar: " + systemInfo.getCalendar());
}
}
Aggregations