我有一个网址:
URL url=new URL("https://example.com/aa/bb/cc/file.html");
和相对路径:
String relativePath="../file2.html"; //maybe is "/file3.html"
我想得到 http://example.com/aa/bb/file2.html
使用变量 url
和 relativePath
怎么做?
原文由 Koerr 发布,翻译遵循 CC BY-SA 4.0 许可协议