private void performDownload ( HttpResponse response , File destFile ) throws IOException { HttpEntity entity = response . getEntity ( ) ; if ( entity == null ) { return ; } //get content length long contentLength = entity . getContentLength ( ) ; if ( contentLength >= 0 ) { size = toLengthText ( contentLength ) ; } processedBytes = 0 ; loggedKb = 0 ; //open stream and start downloading InputStream is = entity . getContent ( ) ; streamAndMove ( is , destFile ) ; }
Save an HTTP response to a file