title: Is there a way to download a .jar file with a httpurlconnection?
body: <p>The server is sending a jar file and i want to save it in a specific directory.
  My HttpURLConnection is only reading the content of the file</p>
  <pre><code>public static String update(String url, String version) throws MalformedURLException, IOException {
      HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();
          
      return readResponse(con.getInputStream());
  }
  </code></pre>
  <pre><code>private static String readResponse(InputStream in){
      BufferedReader br = new BufferedReader(new InputStreamReader((in)));
      StringBuilder sb = new StringBuilder();
      String output;
      while ((output = br.readLine()) != null) {
          sb.append(output);
      }
      return sb.toString();
  }
  </code></pre>