Here you can find the source of relativize(String path, String base)
Parameter | Description |
---|---|
patha | a parameter |
pathb | a parameter |
public static String relativize(String path, String base)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**/*w w w. ja v a2 s . c o m*/ * Returns the path relative to the base. * * @param patha * @param pathb * @return */ public static String relativize(String path, String base) { return new File(base).toURI().relativize(new File(path).toURI()).getPath(); } }