@Test public void testServerTimeRetrieval() throws ServletException, IOException { withRequestPath("/system/console/logviewer/serverTime"); doGet(); assertResponseMatches("\\{\"time\": \"[0-9]{1,2}.[0-9]{1,2}.[0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]+ \\(UTC \\+ [0-9]+\\)\"\\}"); }
@Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String suffix = substringAfter(req.getRequestURI(), req.getServletPath() + "/" + getLabel()); if (!isBlank(suffix) && suffix.startsWith("/tail")) { this.tailServlet.service(req, res); return; } if ("/download".equals(suffix)) { download(res, req); return; } if ("/serverTime".equals(suffix)) { serverTime(res); return; } super.doGet(req, res); }
LogfileViewerConsolePlugin extends AbstractWebConsolePlugin { @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String suffix = substringAfter(req.getRequestURI(), req.getServletPath() + "/" + getLabel()); if (!isBlank(suffix) && suffix.startsWith("/tail")) { this.tailServlet.service(req, res); return; } if ("/download".equals(suffix)) { download(res, req); return; } if ("/serverTime".equals(suffix)) { serverTime(res); return; } super.doGet(req, res); } }
LogfileViewerConsolePlugin extends AbstractWebConsolePlugin { @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String suffix = substringAfter(req.getRequestURI(), req.getServletPath() + "/" + getLabel()); if (!isBlank(suffix) && suffix.startsWith("/tail")) { this.tailServlet.service(req, res); return; } if ("/download".equals(suffix)) { download(res, req); return; } if ("/serverTime".equals(suffix)) { serverTime(res); return; } super.doGet(req, res); }  }
LogfileViewerConsolePlugin extends AbstractWebConsolePlugin { @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String suffix = substringAfter(req.getRequestURI(), req.getServletPath() + "/" + getLabel()); if (!isBlank(suffix) && suffix.startsWith("/tail")) { this.tailServlet.service(req, res); return; } if ("/download".equals(suffix)) { download(res, req); return; } if ("/serverTime".equals(suffix)) { serverTime(res); return; } super.doGet(req, res); }  @Override void init(); @Override void destroy(); @SuppressWarnings("unused") String getCategory(); URL getResource(String path); @Override String getTitle(); @Override String getLabel(); }
LogfileViewerConsolePlugin extends AbstractWebConsolePlugin { @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String suffix = substringAfter(req.getRequestURI(), req.getServletPath() + "/" + getLabel()); if (!isBlank(suffix) && suffix.startsWith("/tail")) { this.tailServlet.service(req, res); return; } if ("/download".equals(suffix)) { download(res, req); return; } if ("/serverTime".equals(suffix)) { serverTime(res); return; } super.doGet(req, res); }  @Override void init(); @Override void destroy(); @SuppressWarnings("unused") String getCategory(); URL getResource(String path); @Override String getTitle(); @Override String getLabel();  }