title: Error downloading file from a given URL
body: <p>I am trying to download the given URL:
   <code>http://www.addic7ed.com/original/9521/7</code></p>
  
  <p>but when i try to download the file using my Java Code:</p>
  
  <pre><code>URL url = new URL("http://www.addic7ed.com/original/9521/7");
  ReadableByteChannel rbc = Channels.newChannel(url.openStream());
  FileOutputStream fos = new FileOutputStream("abc.srt"); 
  fos.getChannel().transferFrom(rbc, 0, 1 &lt;&lt; 24);
  </code></pre>
  
  <p>The <code>html page</code> gets downloaded whereas the file to be downloaded should be a <code>.srt extension</code> file.</p>
  
  <p>But when I try to download the above link using <code>Internet Download Manager</code> the file gets downloaded.</p>
  
  <p><code>IDM</code> converts the above given URL into <code>http://www.addic7ed.com/srtcache/Supernatural/Supernatural%20-%2004x06%20-%20Yellow%20Fever.720p%20CTU.English.orig.Addic7ed.com.srt</code></p>
  
  <p>So my question is how to achieve this in JAVA...?? Are there any API available to achieve this.</p>