title: Getting a file from an http request in java
body: <p>How do I call a url in order to process the results?</p>
  
  <p>I have a stand-alone reporting servlet which I link to for reports. I want to email these reports now, if I were doing this in the browser, I could just use an xhttprequest, and process the results - I basically want to do the same thing in Java, but I'm not sure how to go about it.</p>
  
  <p><strong>UPDATE</strong>: I'm looking to get a file back from the url (whether that be a pdf or html etc).</p>
  
  <p><strong>UPDATE</strong>: This will be running purely on the server - there is no request that triggers the emailing, rather it is a scheduled email.</p>