title: Check if URL is valid or exists in java
body: <p>I'm writing a Java program which hits a list of urls and needs to first know if the url exists. I don't know how to go about this and cant find the java code to use.</p>
  
  <p>The URL is like this: </p>
  
  <pre><code>http: //ip:port/URI?Attribute=x&amp;attribute2=y
  </code></pre>
  
  <p>These are URLs on our internal network that would return an XML if valid.</p>
  
  <p>Can anyone suggest some code?</p>