SymbolicLinkHelper implements ISystemFileCommandsHelper { public static String readSymbolicLink(String link) { if (nonNull(link)) { try { Path linkPath = Paths.get(link); if (nonNull(linkPath)) { Path pathObject = Files.readSymbolicLink(linkPath); if (nonNull(pathObject)) { return pathObject.toString(); } } } catch (Exception thr) { Log.error("Unexpected exception invoking method: %s", thr.getLocalizedMessage()); Log.exception(thr); } } return null; }  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 testReadSymbolicLink() throws IOException { Path tempLink = createTempLink(); assertEquals( tempFile.toString(), SymbolicLinkHelper.readSymbolicLink(tempLink.toString())); }
@Test public void testReadSymbolicLinkNull() throws IOException { assertNull(SymbolicLinkHelper.readSymbolicLink(null)); }
@Test public void testReadSymbolicLinkEmpty() throws IOException { assertNull(SymbolicLinkHelper.readSymbolicLink("")); }
@Test public void testReadSymbolicLinkInvalid() throws IOException { assertNull(SymbolicLinkHelper.readSymbolicLink( RandomStringUtils.randomNumeric(10))); }