title: Download a file from the internet using java : How to authenticate?
body: <p>Thanks to this thread <a href="https://stackoverflow.com/questions/921262/how-to-download-and-save-a-file-from-internet-using-java">How to download and save a file from Internet using Java?</a>
  I know how to download a file, now my problem is that I need to authenticate on the sever from which I'm dowloading. It's an http interface to a subversion server. Which field do I need to look up into ?</p>
  
  <p>Using the code posted in the last comment, I get this exception:</p>
  
  <pre><code>java.io.IOException: Server returned HTTP response code: 401 for URL: http://myserver/systemc-2.0.1.tgz
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1305)
      at java.net.URL.openStream(URL.java:1009)
      at mypackage.Installer.installSystemc201(Installer.java:29)
      at mypackage.Installer.main(Installer.java:38)
  </code></pre>
  
  <p>Thanks,</p>