SymbolicLinkHelper implements ISystemFileCommandsHelper { public static long getLastModifiedTime(String link) { if (nonNull(link)) { try { Path linkPath = Paths.get(link); if (nonNull(linkPath)) { FileTime fileTimeObject = Files.getLastModifiedTime(linkPath, LinkOption.NOFOLLOW_LINKS); if (nonNull(fileTimeObject)) { return fileTimeObject.toMillis(); } } } catch (Exception thr) { Log.error("Unexpected exception invoking method: %s", thr.getLocalizedMessage()); Log.exception(thr); } } return 0L; }  static boolean isSymbolicLinkCapable(); static boolean isSymbolicLink(String path); static String readSymbolicLink(String link); static long getLastModifiedTime(String link); static boolean exists(String path); static String move(String source, String target); static String createSymbolicLink(String link, String target);  }
@Test public void testLastModifiedTimeNull() throws IOException { assertEquals(0L, SymbolicLinkHelper.getLastModifiedTime(null)); }
@Test public void testLastModifiedTimeInvalid() throws IOException { assertEquals(0L, SymbolicLinkHelper.getLastModifiedTime( RandomStringUtils.randomNumeric(10))); }
@Test public void testLastModifiedTime() throws IOException { Path tempLink = createTempLink(); assertTrue("There are more than 5 milliseconds between the last modified times of <" + tempLink + "> and its target", Files.getLastModifiedTime(tempLink).toMillis()-10 < SymbolicLinkHelper.getLastModifiedTime(tempLink.toString())); }