protected void addHeaders(HttpURLConnection connection,String tenantId){
  if (tenantId == null) {
    tenantId=PropertyUtil.getProperty(PropertyUtil.HAWKULAR_TENANT);
  }
  if (tenantId != null) {
    connection.setRequestProperty(HAWKULAR_TENANT,tenantId);
  }
  if (authorization == null && username != null) {
    String authString=username + ":" + password;
    String encoded=encoder.encodeToString(authString.getBytes());
    authorization="Basic " + encoded;
  }
  if (authorization != null) {
    connection.setRequestProperty("Authorization",authorization);
  }
}

protected void addHeaders ( HttpURLConnection connection , String tenantId ) { if ( tenantId == null ) { tenantId = PropertyUtil . getProperty ( PropertyUtil . HAWKULAR_TENANT ) ; } if ( tenantId != null ) { connection . setRequestProperty ( HAWKULAR_TENANT , tenantId ) ; } if ( authorization == null && username != null ) { String authString = username + ":" + password ; String encoded = encoder . encodeToString ( authString . getBytes ( ) ) ; authorization = "Basic " + encoded ; } if ( authorization != null ) { connection . setRequestProperty ( "Authorization" , authorization ) ; } }
add the header values to the supplied connection .
