Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > (extra) parsing (and verifying of) URL's via java.net.URI ...

Reply
Thread Tools

(extra) parsing (and verifying of) URL's via java.net.URI ...

 
 
qwertmonkey@syberianoutpost.ru
Guest
Posts: n/a
 
      10-21-2012
~
as stated in the API
~
http://docs.oracle.com/javase/7/docs...a/net/URI.html
~
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. For example, there
are lots of extra suffixes the Japanese apparently guard (basically all cities
and prefectures):
~
".ac.jp", ".abashiri.hokkaido.jp", ...
~
Noregeans do the same thing: ".fylkesbibl.no", ".gs.[county].no", ...
~
I think in the states they have similar restrictions regarding tlds and
suffixes such as ".edu" and ".mil" and the French even guard their dentists to
the point of pairing them with surgeons: ".chirurgiens-dentistes.fr"
~
Those parsing issues are important in use cases in which you want to know
what is in a host name:
~
$ host www.dos.state.fl.us
www.dos.state.fl.us has address 207.156.20.19

$ host dos.state.fl.us
dos.state.fl.us has address 207.156.20.19
dos.state.fl.us mail is handled by 10 mail.dos.state.fl.us.
dos.state.fl.us mail is handled by 20 xm.dos.state.fl.us.

$ host state.fl.us
state.fl.us mail is handled by 10 dohsmsi07.doh.state.fl.us.
state.fl.us mail is handled by 10 dohsmsi06.doh.state.fl.us.

$ host doh.state.fl.us
doh.state.fl.us has address 199.250.17.86
doh.state.fl.us mail is handled by 1 mx0003.doh.state.fl.us.
doh.state.fl.us mail is handled by 1 mx5201.doh.state.fl.us.
doh.state.fl.us mail is handled by 1 mx0001.doh.state.fl.us.
doh.state.fl.us mail is handled by 1 mx0002.doh.state.fl.us.

$ host fl.us
$
~
subdepartments inside of a University department may have their own
website (or not)
~
$ host cornell.edu
cornell.edu has address 128.253.173.242
cornell.edu has address 128.253.173.243
cornell.edu has address 128.253.173.244
cornell.edu has address 128.253.173.245
cornell.edu has address 128.253.173.246
cornell.edu has address 128.253.173.241
cornell.edu mail is handled by 10 router2.mail.cornell.edu.
cornell.edu mail is handled by 10 router3.mail.cornell.edu.
cornell.edu mail is handled by 10 router4.mail.cornell.edu.
cornell.edu mail is handled by 10 router9.mail.cornell.edu.
cornell.edu mail is handled by 10 router10.mail.cornell.edu.
cornell.edu mail is handled by 10 router1.mail.cornell.edu.

knoppix@Microknoppix:~$ host www.cs.cornell.edu
www.cs.cornell.edu is an alias for www1.cs.cornell.edu.
www1.cs.cornell.edu has address 128.84.154.137

knoppix@Microknoppix:~$ host www.cornell.edu
www.cornell.edu is an alias for wwwcornelledu-ssl.cit.cornell.edu.
wwwcornelledu-ssl.cit.cornell.edu has address 132.236.204.10
~
There is lots of info scattered all over the Internet about web naming issues
~
http://www.cs.cornell.edu/people/egs.../dnssurvey.pdf
~
but AFAIK there is not central registry of such data. Do you know better?
~
thanks
lbrtchx
comp.lang.java.programmer: (extra) parsing (and verifying of) URL's via java.net.URI ...
 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      10-21-2012
On 10/21/2012 7:45 AM, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> ~
> as stated in the API
> ~
> http://docs.oracle.com/javase/7/docs...a/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.



 
Reply With Quote
 
 
 
 
Arne Vajhoej
Guest
Posts: n/a
 
      10-21-2012
On 10/21/2012 10:45 AM, (E-Mail Removed) wrote:
> ~
> as stated in the API
> ~
> http://docs.oracle.com/javase/7/docs...a/net/URI.html
> ~
> 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,


You can get the hostname out and then split on period and take the last.

> as well as suffixes that some regional
> registrar authorities mark as not publicly available. For example, there
> are lots of extra suffixes the Japanese apparently guard (basically all cities
> and prefectures):
> ~
> ".ac.jp", ".abashiri.hokkaido.jp", ...
> ~
> Noregeans do the same thing: ".fylkesbibl.no", ".gs.[county].no", ...
> ~
> I think in the states they have similar restrictions regarding tlds and
> suffixes such as ".edu" and ".mil" and the French even guard their dentists to
> the point of pairing them with surgeons: ".chirurgiens-dentistes.fr"


I don't think the Java vendors would want to maintain logic that reflect
different policies in 200 TLD's.

Maintaining something as simple as timezones is hard enough.

Arne

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      10-23-2012
See http://mindprod.com/jgloss/tld.html
and follow links. That will at least give you all the country domains
and the major global ones.
--
Roedy Green Canadian Mind Products http://mindprod.com
There are four possible ways to poke a card into a slot.
Nearly always, only one way works. To me that betrays a
Fascist mentality, demanding customers conform to some
arbitrary rule, and hassling them to discover the magic
orientation. The polite way to do it is to design the reader
slot so that all four ways work, or so that all the customer
has to do is put the card in the vicinity of the reader.


 
Reply With Quote
 
paul.cager@googlemail.com
Guest
Posts: n/a
 
      10-23-2012
On Sunday, October 21, 2012 3:45:43 PM UTC+1, (E-Mail Removed) wrote:
> 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.


I think markspace's advice is best as there is no foolproof way to determine if a string is a host name or a domain name (even if you look at DNS "A" / "AAA" records).

But maybe http://publicsuffix.org/list/ (was https://wiki.mozilla.org/TLD_List) will help you do whatever it is you want to do.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Verifying DNS with Cisco 837 Doc Oakenfold Cisco 1 12-17-2008 01:05 PM
Verifying someone is really certified. kb Microsoft Certification 3 07-30-2005 05:02 AM
NAT Configuration question: verifying availability before NAT Sri Cisco 0 07-19-2005 02:13 PM
verifying multicasting J R Cisco 3 09-02-2004 06:42 AM
Verifying Multicast Settings J R Cisco 2 08-20-2004 12:17 AM



Advertisments