@Ignore("For ad-hoc testing with \\ in paths.") @Test public void mightResolveBackslashesToo() throws IOException { final String MY_VAR_FOLDERS = "\\var\\folders\\58\\546k9lk08xl56t0059bln0_h0000gp\\T"; final String EXPECTED_REL = MY_VAR_FOLDERS.substring("/var/".length()). replace('\\', '/'); 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);  }