Java Utililty Methods Path Subtract

List of utility methods to do Path Subtract

Description

The list of methods to do Path Subtract are organized into topic(s).

Method

StringsubtractPath(String base, String full)
subtract Path
return full.substring(base.length() + 1);
StringsubtractPaths(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("/");
...