List of utility methods to do Path Subtract
String | subtractPath(String base, String full) subtract Path return full.substring(base.length() + 1);
|
String | subtractPaths(String longPath, String shortPath) subtract Paths StringBuilder sb = new StringBuilder(); String[] parts1 = longPath.split("/"); String[] parts2 = shortPath.split("/"); for (int i = 0; i < parts1.length; i++) { if (i >= parts2.length || !parts1[i].equals(parts2[i])) { for (int j = i; j < parts1.length; j++) { if (sb.length() > 0) sb.append("/"); ... |