How to get URL using relative path?

Viewed 63435

I have a URL:

URL url=new URL("https://example.com/aa/bb/cc/file.html");

and a relative path:

String relativePath="../file2.html"; //maybe is "/file3.html"

I want to get http://example.com/aa/bb/file2.html using variable url and relativePath

How to do it?

6 Answers

What I found worked is this:

new URL("file:./src/gui/Something.fxml")

This worked for my code
URL url=Myclass.class.getResource("/com/fnf/si/DepAcctInq_V02.wsdl");

Related