Java 计算相对路径
时间:2020-08-26 21:54:54
收藏:0
阅读:137
import java.nio.file.Path;
import java.nio.file.Paths;
public class temp {
public static void main(String[] args) {
Path pathAbsolute = Paths.get("src\\Portal\\Client\\assets\\tts\\");
Path pathBase = Paths.get("src\\Portal\\Client\\src\\component\\tts\\data\\dataRecordingComponents");
Path pathRelative = pathBase.relativize(pathAbsolute);
System.out.println(pathRelative);
}
}
原文:https://www.cnblogs.com/xym4869/p/13567221.html
评论(0)