I have got URL as referrer and want to get protocol and domain from it.
For example: If URL is https://test.domain.com/a/b/c.html?test=hello
then output needs to be https://test.domain.com
. I have gone through http://docs.oracle.com/javase/7/docs/api/java/net/URI.html
and I can't seems to find any method that can directly do so.
I am not using Spring, so can't use Sprint classes (if any).
Guys I can write custom login to get port, domain and protocol from URL, but looking for API which already has this implemented and can minimize my time in testing various scenarios.