• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checking the IP address

 
Roy Mallard
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently using sun.net.util.IPAddressUtil to determine if the string entered by the user is a valid IP address. Is this considered part of the "core" Java classes?
If not, what is a good way of checking for a valid IP address? I could create a new URL and catch the MalformedURLException but I think that falls under "using exceptions for flow control". Anyone have any bright ideas?
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would this make it clearer?

Why Developers Should Not Write Programs That Call 'sun' Packages

Use the classes in the java.net package instead. Maybe java.net.InetAddress could help in this regard.
[ December 18, 2006: Message edited by: Edwin Dalorzo ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic