title: Connection Refused when trying to download file from Sharepoint
body: <p>I am trying to download a .xlsx file via the following Java code:</p>
  
  <pre><code>InputStream input = new URL("https://some.example-website.com/path/to/the/file.xlsx").openStream();
  </code></pre>
  
  <p><strong>This .xlsx file is on a Sharepoint website.</strong></p>
  
  <p>If I visit the URL directly in my browser it will download the file automatically in Chrome so I'm confused as to why when I run the above code from my machine I receive:</p>
  
  <pre><code>Exception in thread "main" java.net.ConnectException: Connection refused: connect
  </code></pre>
  
  <p>I am looking for a way to download and save this .xlsx file using a tool written in Java ran from my machine.</p>