jetbrick-commons/src/main/java/jetbrick/io/PathUtils.java
public static String getRelativePath(final String path, final String relativePath) {
        if (relativePath.startsWith("/")) {
            return normalize(relativePath);
        }
        int separatorIndex = path.lastIndexOf('/');
        if (separatorIndex != -1) {
            String newPath = path.substring(0, separatorIndex + 1);
            return normalize(newPath + relativePath);
        } else {
            return normalize(relativePath);
        }
    }
public static String getRelativePath(final String path, final String relativePath) {
        if (relativePath.startsWith("/")) {
            return normalize(relativePath);
        }
        int separatorIndex = path.lastIndexOf('/');
        if (separatorIndex != -1) {
            String newPath = path.substring(0, separatorIndex + 1);
            return normalize(newPath + relativePath);
        } else {
            return normalize(relativePath);
        }
    }
public static String getRelativePath ( final String path , final String relativePath ) { if ( relativePath . startsWith ( "/" ) ) { return normalize ( relativePath ) ; } int separatorIndex = path . lastIndexOf ( ' ' ) ; if ( separatorIndex != - 1 ) { String newPath = path . substring ( 0 , separatorIndex + 1 ) ; return normalize ( newPath + relativePath ) ; } else { return normalize ( relativePath ) ; } }
计算相对路径.
计算相对路径 .