title: Reading http file on url
body: <p>I am trying to read an xml file on an http url. "Unexpected end of file from server" keeps on coming . the page is password protected, I would like to know if I am properly giving in my url authentication details. </p>
  
  <p>I tried with non protected pages and I can read them properly. Here is my code:</p>
  
  <pre><code>URL url = new URL("http://username:pass@0.0.0.0:0000/test.xml");
  URLConnection yc = url.openConnection();
  BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
  String inputLine;
  while ((inputLine = in.readLine()) != null) 
          System.out.println(inputLine);
  in.close();
  </code></pre>