public static BaseResponse newResponseObject(String contentTypeHeader){
  String contentType=StringUtils.isNotBlank(contentTypeHeader) ? contentTypeHeader : "";
  if (contentType.contains("xml")) {
    return new XMLResponse();
  }
 else   if (contentType.contains("json")) {
    return new JsonResponse();
  }
 else {
    return new BinaryResponse();
  }
}

public static BaseResponse newResponseObject ( String contentTypeHeader ) { String contentType = StringUtils . isNotBlank ( contentTypeHeader ) ? contentTypeHeader : "" ; if ( contentType . contains ( "xml" ) ) { return new XMLResponse ( ) ; } else if ( contentType . contains ( "json" ) ) { return new JsonResponse ( ) ; } else { return new BinaryResponse ( ) ; } }
new up a response object depending on the content type
