Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I know that java.net.URL tries to resolve the URL; does java.net.URI do the same?

Tags:

java

url

uri

A quick Google didn't turn up a definitive answer. If URI does do this, is there a widespread third-party library that won't do this? I just need some parsing, and I can't have unpredictable delays while the constructor attempts to resolve a URI?

Thanks.

like image 353
Hank Gay Avatar asked Dec 14 '22 02:12

Hank Gay


1 Answers

From the URI javadoc:

No lookup of the host, if any, is performed, and no scheme-dependent stream handler is constructed. Equality, hashing, and comparison are defined strictly in terms of the character content of the instance. In other words, a URI instance is little more than a structured string that supports the syntactic, scheme-independent operations of comparison, normalization, resolution, and relativization.

like image 168
McDowell Avatar answered Feb 15 '23 11:02

McDowell