CliServerRouter implements Router { static boolean isModified(long fileLastModified, String since) { ZonedDateTime sinceDate; try { sinceDate = ZonedDateTime.from(DateTimeFormatter.RFC_1123_DATE_TIME.parse(since)); } catch (Exception e) { return true; } return fileLastModified > sinceDate.toInstant().toEpochMilli(); } CliServerRouter(File rootDir, String rootPath);   CliServerRouter(File rootDir, String rootPath, Properties mediaTypes); private  CliServerRouter(File rootDir, String rootPath, Map<String, String> mimeMapping); @Override Optional<RawHttpResponse<?>> route(RawHttpRequest request); static final String DIR_BACK_PATTERN; }
@Test public void canTellIfFileIsModifiedSinceDate() { assertFalse(CliServerRouter.isModified(0L, "Sat, 29 Oct 1994 19:43:31 GMT")); assertTrue(CliServerRouter.isModified( Instant.parse("2007-12-03T10:15:30.00Z").toEpochMilli(), "Sat, 29 Oct 1994 19:43:31 GMT")); assertFalse(CliServerRouter.isModified( Instant.parse("1994-10-29T19:43:31.00Z").toEpochMilli(), "Sat, 29 Oct 1994 19:43:31 GMT")); assertTrue(CliServerRouter.isModified( Instant.parse("1994-10-29T19:43:31.01Z").toEpochMilli(), "Sat, 29 Oct 1994 19:43:31 GMT")); }