private void addRequestHeaders(State state,HttpURLConnection conn){
  for (  Pair<String,String> header : originalDownloadInfo.getHeaders()) {
    conn.addRequestProperty(header.first,header.second);
  }
  if (conn.getRequestProperty("User-Agent") == null) {
    conn.addRequestProperty("User-Agent",userAgent());
  }
  conn.setRequestProperty("Accept-Encoding","identity");
  if (state.continuingDownload) {
    if (state.headerETag != null) {
      conn.addRequestProperty("If-Match",state.headerETag);
    }
    conn.addRequestProperty("Range","bytes=" + state.currentBytes + "-");
  }
}

private void addRequestHeaders ( State state , HttpURLConnection conn ) { for ( Pair < String , String > header : originalDownloadInfo . getHeaders ( ) ) { conn . addRequestProperty ( header . first , header . second ) ; } if ( conn . getRequestProperty ( "User-Agent" ) == null ) { conn . addRequestProperty ( "User-Agent" , userAgent ( ) ) ; } conn . setRequestProperty ( "Accept-Encoding" , "identity" ) ; if ( state . continuingDownload ) { if ( state . headerETag != null ) { conn . addRequestProperty ( "If-Match" , state . headerETag ) ; } conn . addRequestProperty ( "Range" , "bytes=" + state . currentBytes + "-" ) ; } }
add custom headers for this download to the http request .
