Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: (extra) parsing (and verifying of) URL's via java.net.URI ... Date: Sun, 21 Oct 2012 09:43:58 -0700 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 21 Oct 2012 16:44:01 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="61282af8d6595e8d991edb5ac03d6e00"; logging-data="30753"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19k1RCWVer/pi8Q/NE0BtDPPtSuqn4+3Bs=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: Cancel-Lock: sha1:s362fVWIsgr+3uVIie85oo3S65o= Xref: csiph.com comp.lang.java.programmer:19458 On 10/21/2012 7:45 AM, qwertmonkey@syberianoutpost.ru wrote: > ~ > as stated in the API > ~ > http://docs.oracle.com/javase/7/docs/api/java/net/URI.html Relating this to your subject title, URIs are not URLs. You can't really "verify" a URI, they're just strings. > ~ > this would be an extra feature, but it would be nice if as part of the API > you could tell apart what is a TLD, as well as suffixes that some regional > registrar authorities mark as not publicly available. Why? Just send info to the host name. If it gets there it's correct. Otherwise send an error message to the user. Plus URLs may be relative. There might be no TLD in the string at all. > ~ > Those parsing issues are important in use cases in which you want to know > what is in a host name: What makes you think this information is important? Why would you care? Just use the hostname as given.