@Test public void shouldHandleEffectivelySameInputs() throws IOException { String USR_BIN = Paths.get(Paths.get("/usr/bin").toUri()).toString(); String rel = PathUtils.getRelativeToCanonical(USR_BIN + File.separator, USR_BIN); Assert.assertEquals(USR_BIN + " rel to ~itself", "", rel); }
public static String getRelativeToCanonical(String path, String canonical) throws IOException { try { return getRelativeToCanonical(path, canonical, null, null); } catch (ForbiddenSymlinkException e) { return path; } }
PathUtils { public static String getRelativeToCanonical(String path, String canonical) throws IOException { try { return getRelativeToCanonical(path, canonical, null, null); } catch (ForbiddenSymlinkException e) { return path; } } }
PathUtils { public static String getRelativeToCanonical(String path, String canonical) throws IOException { try { return getRelativeToCanonical(path, canonical, null, null); } catch (ForbiddenSymlinkException e) { return path; } } private  PathUtils(); }
PathUtils { public static String getRelativeToCanonical(String path, String canonical) throws IOException { try { return getRelativeToCanonical(path, canonical, null, null); } catch (ForbiddenSymlinkException e) { return path; } } private  PathUtils(); static String getRelativeToCanonical(String path, String canonical); static String getRelativeToCanonical(String path, String canonical,
            Set<String> allowedSymlinks, Set<String> canonicalRoots); }
PathUtils { public static String getRelativeToCanonical(String path, String canonical) throws IOException { try { return getRelativeToCanonical(path, canonical, null, null); } catch (ForbiddenSymlinkException e) { return path; } } private  PathUtils(); static String getRelativeToCanonical(String path, String canonical); static String getRelativeToCanonical(String path, String canonical,
            Set<String> allowedSymlinks, Set<String> canonicalRoots);  }