@Ignore("macOS has /var symlink, and I also made a second link, `myhome'.") @Test public void shouldResolvePrivateVarOnMacOS() throws IOException { final String MY_VAR_FOLDERS = "/var/folders/58/546k9lk08xl56t0059bln0_h0000gp/T/tilde/Documents"; final String EXPECTED_REL = MY_VAR_FOLDERS.substring("/var/".length()); String rel = PathUtils.getRelativeToCanonical(MY_VAR_FOLDERS, "/private/var"); Assert.assertEquals("/var/run rel to /private/var", EXPECTED_REL, 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);  }