Here you can find the source of relativeURI(String basePath, String path)
Parameter | Description |
---|---|
basePath | The base path of the requested relative path |
path | The path of which the relative URI is requested |
public static URI relativeURI(String basePath, String path)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.net.URI; public class Main { /**//from w w w.ja va2 s. com * Return the relative URI of the given path with respect to * the given base path. * * @param basePath The base path of the requested relative path * @param path The path of which the relative URI is requested */ public static URI relativeURI(String basePath, String path) { return new File(basePath).toURI().relativize(new File(path).toURI()); } }