title: HttpURLConnection downloaded file name
body: <p>Is it possible to get the name of a file downloaded with HttpURLConnection?</p>
  
  <pre><code>URL url = new URL("http://somesite/getFile?id=12345");
  HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  conn.setRequestMethod("GET");
  conn.setAllowUserInteraction(false);
  conn.setDoInput(true);
  conn.setDoOutput(true);
  conn.connect();
  InputStream is = conn.getInputStream();
  </code></pre>
  
  <p>In the example above I cannot extract the file name from the URL, but the server will send me the file name in some way.</p>