title: How do I save a file downloaded with HttpClient into a specific folder
body: <p>I am trying to download a PDF file with HttpClient. I am able to get the file but i am not sure how to convert the bytes into a a PDF and store it somewhere on the system</p>
  
  <p>I have the following code, How can I store it as a PDF?</p>
  
  <pre><code> public ???? getFile(String url) throws ClientProtocolException, IOException{
  
              HttpGet httpget = new HttpGet(url);
              HttpResponse response = httpClient.execute(httpget);
              HttpEntity entity = response.getEntity();
              if (entity != null) {
                  long len = entity.getContentLength();
                  InputStream inputStream = entity.getContent();
                  // How do I write it?
              }
  
              return null;
          }
  </code></pre>