title: InputStream from a URL
body: <p>How do I get an InputStream from a URL?</p>
  
  <p>for example, I want to take the file at the url <code>wwww.somewebsite.com/a.txt</code> and read it as an InputStream in Java, through a servlet.</p>
  
  <p>I've tried</p>
  
  <pre><code>InputStream is = new FileInputStream("wwww.somewebsite.com/a.txt");
  </code></pre>
  
  <p>but what I got was an error:</p>
  
  <pre><code>java.io.FileNotFoundException
  </code></pre>