diff -r 2a190d8613ca AndroidManifest.xml
--- a/AndroidManifest.xml Fri Aug 05 21:13:30 2011 -0700
+++ b/AndroidManifest.xml Thu Sep 08 12:20:43 2011 -0400
@@ -46,6 +46,12 @@
android:mimeType="vnd.android.cursor.item/vnd.odk.instance" />
+
+
@@ -151,6 +157,13 @@
+
+
+
-
+
+
+
+
+
+
diff -r 2a190d8613ca res/values/arrays.xml
--- a/res/values/arrays.xml Fri Aug 05 21:13:30 2011 -0700
+++ b/res/values/arrays.xml Thu Sep 08 12:20:43 2011 -0400
@@ -35,11 +35,13 @@
- odk_default
+ - google
- ODK Default
+ - Google
- Custom
Select Answer
Form will be saved as:
Saved name must not be blank!
+Select Google Account
diff -r 2a190d8613ca src/org/odk/collect/android/activities/AccountInfo.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/odk/collect/android/activities/AccountInfo.java Thu Sep 08 12:20:43 2011 -0400
@@ -0,0 +1,134 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+
+package org.odk.collect.android.activities;
+
+import android.accounts.Account;
+import android.accounts.AccountManager;
+import android.accounts.AccountManagerCallback;
+import android.accounts.AccountManagerFuture;
+import android.accounts.AuthenticatorException;
+import android.accounts.OperationCanceledException;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.util.Log;
+
+import org.odk.collect.android.preferences.PreferencesActivity;
+
+import java.io.IOException;
+
+/**
+ * Activity to authenticate against an account and generate a token into the
+ * shared preferences.
+ *
+ * @author cswenson@google.com (Christopher Swenson)
+ *
+ */
+public class AccountInfo extends Activity {
+ final static int WAITING_ID = 1;
+ final static String authString = "cp";
+
+ /**
+ * Activity startup.
+ */
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ }
+
+ /**
+ * When we resume, try to get an auth token.
+ */
+ @Override
+ protected void onResume() {
+ super.onResume();
+ Intent intent = getIntent();
+ AccountManager accountManager = AccountManager.get(getApplicationContext());
+ Account account = (Account) intent.getExtras().get("account");
+ accountManager.getAuthToken(account, authString, false, new AuthTokenCallback(), null);
+ showDialog(WAITING_ID);
+ }
+
+ /**
+ * Helper class to handle getting the auth token.
+ *
+ * @author cswenson@google.com (Christopher Swenson)
+ */
+ private class AuthTokenCallback implements AccountManagerCallback {
+ @Override
+ public void run(AccountManagerFuture result) {
+ Bundle bundle;
+ try {
+ bundle = result.getResult();
+ Intent intent = (Intent) bundle.get(AccountManager.KEY_INTENT);
+ if (intent != null) {
+ // Use the bundle dialog.
+ startActivity(intent);
+ } else {
+ gotAuthToken(bundle);
+ }
+ } catch (OperationCanceledException e) {
+ failedAuthToken();
+ } catch (AuthenticatorException e) {
+ failedAuthToken();
+ } catch (IOException e) {
+ failedAuthToken();
+ }
+ }
+ }
+
+ /**
+ * If we failed to get an auth token.
+ */
+ protected void failedAuthToken() {
+ dismissDialog(WAITING_ID);
+ // TODO(cswenson@google.com): Show an error dialog.
+ finish();
+ }
+
+ /**
+ * If we got one, store it in shared preferences.
+ *
+ * @param bundle
+ */
+ protected void gotAuthToken(Bundle bundle) {
+ // Set the authentication token and dismiss the dialog.
+ String auth_token = bundle.getString(AccountManager.KEY_AUTHTOKEN);
+ Log.d("Collect", "Account type: " + bundle.getString(AccountManager.KEY_ACCOUNT_TYPE));
+ Log.d("Collect", "Account label: " + bundle.getString(AccountManager.KEY_AUTH_TOKEN_LABEL));
+ Log.d("Collect", "Account token: " + bundle.getString(AccountManager.KEY_AUTHTOKEN));
+
+ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+ SharedPreferences.Editor editor = settings.edit();
+ editor.putString(PreferencesActivity.KEY_AUTH, auth_token);
+ editor.commit();
+ dismissDialog(WAITING_ID);
+ finish();
+ }
+
+ /**
+ * Let the user know we are waiting on the server to authenticate.
+ */
+ @Override
+ protected Dialog onCreateDialog(int id) {
+ Dialog dialog;
+ switch (id) {
+ case WAITING_ID:
+ SharedPreferences settings =
+ PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage("Waiting on authentication").setCancelable(false);
+ AlertDialog alert = builder.create();
+ dialog = alert;
+ break;
+ default:
+ dialog = null;
+ }
+ return dialog;
+ }
+
+}
diff -r 2a190d8613ca src/org/odk/collect/android/activities/AccountList.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/odk/collect/android/activities/AccountList.java Thu Sep 08 12:20:43 2011 -0400
@@ -0,0 +1,99 @@
+// Copyright 2011 Google Inc. All rights reserved.
+
+package org.odk.collect.android.activities;
+
+import android.app.ListActivity;
+import android.accounts.*;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.view.View;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+import org.odk.collect.android.R;
+import org.odk.collect.android.preferences.PreferencesActivity;
+
+
+/**
+ * Provides a popup listing of the accounts on the phone that we can
+ * authenticate against.
+ *
+ * @author cswenson@google.com (Christopher Swenson)
+ */
+public class AccountList extends ListActivity {
+ protected AccountManager accountManager;
+ private static int selected = -1;
+ final private static String SELECTED = "selected";
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ outState.putInt(SELECTED, selected);
+ }
+
+ /**
+ * Called to initialize the activity the first time it is run.
+ */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (savedInstanceState != null) {
+ selected = savedInstanceState.getInt(SELECTED, -1);
+ }
+ }
+
+ /**
+ * Called when the activity is resumed.
+ */
+ @Override
+ public void onResume() {
+ super.onResume();
+ accountManager = AccountManager.get(getApplicationContext());
+ Account[] accounts = accountManager.getAccountsByType("com.google");
+ this.setListAdapter(new ArrayAdapter(this, R.layout.account_chooser, accounts) {
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View row;
+
+ if (convertView == null) {
+ row = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(
+ R.layout.account_chooser, null);
+ } else {
+ row = convertView;
+ }
+ TextView vw = (TextView) row.findViewById(android.R.id.text1);
+ if (position == selected) {
+ vw.setBackgroundColor(Color.LTGRAY);
+ } else {
+ vw.setBackgroundColor(Color.WHITE);
+ }
+ vw.setText(getItem(position).name);
+
+ return row;
+ }
+ });
+ }
+
+ /**
+ * When the user clicks an item, authenticate against that account.
+ */
+ @Override
+ protected void onListItemClick(ListView l, View v, int position, long id) {
+ selected = position;
+ Account account = (Account) getListView().getItemAtPosition(position);
+ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+ SharedPreferences.Editor editor = settings.edit();
+ editor.remove(PreferencesActivity.KEY_AUTH);
+ editor.putString(PreferencesActivity.KEY_ACCOUNT, account.name);
+ editor.commit();
+
+ Intent intent = new Intent(this, AccountInfo.class);
+ intent.putExtra("account", account);
+ startActivity(intent);
+ }
+}
diff -r 2a190d8613ca src/org/odk/collect/android/activities/FormDownloadList.java
--- a/src/org/odk/collect/android/activities/FormDownloadList.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/activities/FormDownloadList.java Thu Sep 08 12:20:43 2011 -0400
@@ -25,6 +25,7 @@
import org.odk.collect.android.preferences.PreferencesActivity;
import org.odk.collect.android.tasks.DownloadFormListTask;
import org.odk.collect.android.tasks.DownloadFormsTask;
+import org.odk.collect.android.utilities.UrlUtils;
import org.odk.collect.android.utilities.WebUtils;
import android.app.AlertDialog;
@@ -367,8 +368,13 @@
getString(R.string.default_server_url));
final String url =
- server + settings.getString(PreferencesActivity.KEY_FORMLIST_URL, "/formList");
+ UrlUtils.fixHttps(server +
+ settings.getString(PreferencesActivity.KEY_FORMLIST_URL, "/formList"),
+ settings);
+ String auth = settings.getString(PreferencesActivity.KEY_AUTH, "");
+
Log.i(t, "Trying to get formList from: " + url);
+
EditText username = (EditText) dialogView.findViewById(R.id.username_edit);
String storedUsername = settings.getString(PreferencesActivity.KEY_USERNAME, null);
@@ -434,6 +440,10 @@
showDialog(PROGRESS_DIALOG);
mDownloadFormsTask = new DownloadFormsTask();
+ SharedPreferences settings =
+ PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+ String auth = settings.getString(PreferencesActivity.KEY_AUTH, "");
+ mDownloadFormsTask.setAuth(auth);
mDownloadFormsTask.setDownloaderListener(this);
mDownloadFormsTask.execute(filesToDownload);
} else {
diff -r 2a190d8613ca src/org/odk/collect/android/activities/InstanceUploaderActivity.java
--- a/src/org/odk/collect/android/activities/InstanceUploaderActivity.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/activities/InstanceUploaderActivity.java Thu Sep 08 12:20:43 2011 -0400
@@ -19,6 +19,7 @@
import org.odk.collect.android.preferences.PreferencesActivity;
import org.odk.collect.android.provider.InstanceProviderAPI.InstanceColumns;
import org.odk.collect.android.tasks.InstanceUploaderTask;
+import org.odk.collect.android.utilities.UrlUtils;
import org.odk.collect.android.utilities.WebUtils;
import android.app.Activity;
@@ -118,10 +119,17 @@
if (mInstanceUploaderTask == null) {
// setup dialog and upload task
showDialog(PROGRESS_DIALOG);
+
+ SharedPreferences settings =
+ PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+
mInstanceUploaderTask = new InstanceUploaderTask();
Long[] toSendArray = new Long[mInstancesToSend.size()];
mInstancesToSend.toArray(toSendArray);
+
+ String auth = settings.getString(PreferencesActivity.KEY_AUTH, "");
+ mInstanceUploaderTask.setAuth(auth);
mInstanceUploaderTask.execute(toSendArray);
}
}
@@ -347,7 +355,11 @@
// Bundle b = new Bundle();
// b.putString(AUTH_URI, url.toString());
// showDialog(AUTH_DIALOG, b);
- mUrl = url.toString();
+ SharedPreferences settings =
+ PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+ mUrl = url.toString();
+ mUrl = UrlUtils.fixHttps(mUrl, settings);
+
showDialog(AUTH_DIALOG);
}
diff -r 2a190d8613ca src/org/odk/collect/android/activities/MainMenuActivity.java
--- a/src/org/odk/collect/android/activities/MainMenuActivity.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/activities/MainMenuActivity.java Thu Sep 08 12:20:43 2011 -0400
@@ -22,7 +22,9 @@
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
@@ -48,7 +50,8 @@
private Button mManageFilesButton;
private Button mSendDataButton;
private Button mReviewDataButton;
-
+ private Button mGoogleButton;
+
private AlertDialog mAlertDialog;
private static boolean EXIT = true;
@@ -104,7 +107,7 @@
startActivity(i);
}
});
-
+
// manage forms button. no result expected.
mManageFilesButton = (Button) findViewById(R.id.manage_forms);
mManageFilesButton.setText(getString(R.string.manage_files));
@@ -115,8 +118,36 @@
startActivity(i);
}
});
+
+ SharedPreferences settings =
+ PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+ String protocol = settings.getString(PreferencesActivity.KEY_PROTOCOL, "odk_default");
+ mGoogleButton = (Button) findViewById(R.id.google_button);
+ mGoogleButton.setVisibility(Button.INVISIBLE);
+ mGoogleButton.setText(getString(R.string.google_account));
+ mGoogleButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent i = new Intent(getApplicationContext(), AccountList.class);
+ startActivity(i);
+ }
+ });
}
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ SharedPreferences settings =
+ PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+ String protocol = settings.getString(PreferencesActivity.KEY_PROTOCOL, "odk_default");
+ Button mGoogleButton = (Button) findViewById(R.id.google_button);
+ if (protocol.equals("google")) {
+ mGoogleButton.setVisibility(Button.VISIBLE);
+ } else {
+ mGoogleButton.setVisibility(Button.INVISIBLE);
+ }
+ }
@Override
protected void onPause() {
diff -r 2a190d8613ca src/org/odk/collect/android/preferences/PreferencesActivity.java
--- a/src/org/odk/collect/android/preferences/PreferencesActivity.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/preferences/PreferencesActivity.java Thu Sep 08 12:20:43 2011 -0400
@@ -58,6 +58,10 @@
public static String KEY_PROTOCOL = "protocol";
public static String KEY_FORMLIST_URL = "formlist_url";
public static String KEY_SUBMISSION_URL = "submission_url";
+
+ public static String KEY_AUTH = "auth";
+ public static String KEY_ACCOUNT = "account";
+
private PreferenceScreen mSplashPathPreference;
private EditTextPreference mSubmissionUrlPreference;
@@ -327,6 +331,23 @@
mSubmissionUrlPreference.setEnabled(false);
}
+ } else if (protocol.equals("google")) {
+ if (mServerUrlPreference != null) {
+ mServerUrlPreference.setEnabled(true);
+ }
+ if (mUsernamePreference != null) {
+ mUsernamePreference.setEnabled(false);
+ }
+ if (mPasswordPreference != null) {
+ mPasswordPreference.setEnabled(false);
+ }
+ if (mFormListUrlPreference != null) {
+ mFormListUrlPreference.setEnabled(false);
+ }
+ if (mSubmissionUrlPreference != null) {
+ mSubmissionUrlPreference.setEnabled(false);
+ }
+
} else {
if (mServerUrlPreference != null) {
mServerUrlPreference.setEnabled(true);
diff -r 2a190d8613ca src/org/odk/collect/android/tasks/DownloadFormListTask.java
--- a/src/org/odk/collect/android/tasks/DownloadFormListTask.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/tasks/DownloadFormListTask.java Thu Sep 08 12:20:43 2011 -0400
@@ -24,6 +24,7 @@
import org.odk.collect.android.logic.FormDetails;
import org.odk.collect.android.preferences.PreferencesActivity;
import org.odk.collect.android.utilities.DocumentFetchResult;
+import org.odk.collect.android.utilities.UrlUtils;
import org.odk.collect.android.utilities.WebUtils;
import android.content.SharedPreferences;
@@ -69,6 +70,8 @@
String downloadPath =
settings.getString(PreferencesActivity.KEY_FORMLIST_URL, "/formlist");
downloadListUrl += downloadPath;
+ downloadListUrl = UrlUtils.fixHttps(downloadListUrl, settings);
+ String auth = settings.getString(PreferencesActivity.KEY_AUTH, "");
// We populate this with available forms from the specified server.
//
@@ -79,7 +82,7 @@
HttpClient httpclient = WebUtils.createHttpClient(WebUtils.CONNECTION_TIMEOUT);
DocumentFetchResult result =
- WebUtils.getXmlDocument(downloadListUrl, localContext, httpclient);
+ WebUtils.getXmlDocument(downloadListUrl, localContext, httpclient, auth);
// If we can't get the document, return the error, cancel the task
if (result.errorMessage != null) {
diff -r 2a190d8613ca src/org/odk/collect/android/tasks/DownloadFormsTask.java
--- a/src/org/odk/collect/android/tasks/DownloadFormsTask.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/tasks/DownloadFormsTask.java Thu Sep 08 12:20:43 2011 -0400
@@ -67,12 +67,16 @@
private static final String NAMESPACE_OPENROSA_ORG_XFORMS_XFORMS_MANIFEST =
"http://openrosa.org/xforms/xformsManifest";
+
+ private String mAuth = "";
+ public void setAuth(String auth) {
+ this.mAuth = auth;
+ }
private boolean isXformsManifestNamespacedElement(Element e) {
return e.getNamespace().equalsIgnoreCase(NAMESPACE_OPENROSA_ORG_XFORMS_XFORMS_MANIFEST);
- }
-
+ }
@Override
protected HashMap doInBackground(ArrayList... values) {
@@ -255,7 +259,7 @@
HttpClient httpclient = WebUtils.createHttpClient(WebUtils.CONNECTION_TIMEOUT);
// set up request...
- HttpGet req = WebUtils.createOpenRosaHttpGet(uri);
+ HttpGet req = WebUtils.createOpenRosaHttpGet(uri, mAuth);
HttpResponse response = null;
try {
@@ -333,7 +337,7 @@
HttpClient httpclient = WebUtils.createHttpClient(WebUtils.CONNECTION_TIMEOUT);
DocumentFetchResult result =
- WebUtils.getXmlDocument(fd.manifestUrl, localContext, httpclient);
+ WebUtils.getXmlDocument(fd.manifestUrl, localContext, httpclient, mAuth);
if (result.errorMessage != null) {
return result.errorMessage;
diff -r 2a190d8613ca src/org/odk/collect/android/tasks/InstanceUploaderTask.java
--- a/src/org/odk/collect/android/tasks/InstanceUploaderTask.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/tasks/InstanceUploaderTask.java Thu Sep 08 12:20:43 2011 -0400
@@ -65,10 +65,14 @@
private InstanceUploaderListener mStateListener;
private static final int CONNECTION_TIMEOUT = 30000;
private static final String fail = "FAILED: ";
-
+
+ private String mAuth = "";
private URI mAuthRequestingServer;
HashMap mResults;
-
+
+ public void setAuth(String auth) {
+ this.mAuth = auth;
+ }
// TODO: This method is like 350 lines long, down from 400.
// still. ridiculous. make it smaller.
@@ -294,7 +298,7 @@
while (j < files.size() || first) {
first = false;
- HttpPost httppost = WebUtils.createOpenRosaHttpPost(u);
+ HttpPost httppost = WebUtils.createOpenRosaHttpPost(u, mAuth);
MimeTypeMap m = MimeTypeMap.getSingleton();
diff -r 2a190d8613ca src/org/odk/collect/android/utilities/UrlUtils.java
--- a/src/org/odk/collect/android/utilities/UrlUtils.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/utilities/UrlUtils.java Thu Sep 08 12:20:43 2011 -0400
@@ -14,11 +14,37 @@
package org.odk.collect.android.utilities;
+import android.content.SharedPreferences;
+
+import org.odk.collect.android.preferences.PreferencesActivity;
+
import java.net.MalformedURLException;
import java.net.URL;
public class UrlUtils {
+ public static String fixHttps(String baseUrl, SharedPreferences settings) {
+ // Check if we are making an authenticated connection.
+ // If so, ensure that we are going over SSL.
+ String auth = settings.getString(PreferencesActivity.KEY_AUTH, "");
+ if (auth.length() == 0) {
+ return baseUrl;
+ }
+
+ String url = baseUrl;
+
+ return url;
+
+ /*if (!url.startsWith("https")) {
+ if (url.startsWith("http://")) {
+ url = url.replaceFirst("http://", "https://");
+ } else {
+ url = "https://" + url;
+ }
+ }
+ return url;*/
+ }
+
public static boolean isValidUrl(String url) {
try {
diff -r 2a190d8613ca src/org/odk/collect/android/utilities/WebUtils.java
--- a/src/org/odk/collect/android/utilities/WebUtils.java Fri Aug 05 21:13:30 2011 -0700
+++ b/src/org/odk/collect/android/utilities/WebUtils.java Thu Sep 08 12:20:43 2011 -0400
@@ -148,20 +148,35 @@
public static final HttpGet createOpenRosaHttpGet(URI uri) {
- HttpGet req = new HttpGet();
+ return createOpenRosaHttpGet(uri, "");
+ }
+
+ public static final HttpGet createOpenRosaHttpGet(URI uri, String auth) {
+ HttpGet req = new HttpGet();
+ setOpenRosaHeaders(req);
+ setGoogleHeaders(req, auth);
+ req.setURI(uri);
+ return req;
+ }
+
+ public static final void setGoogleHeaders(HttpRequest req, String auth) {
+ if ((auth != null) && (auth.length() > 0)) {
+ req.setHeader("Authorization", "GoogleLogin auth=" + auth);
+ }
+ }
+
+ public static final HttpPost createOpenRosaHttpPost(URI uri) {
+ return createOpenRosaHttpPost(uri, "");
+ }
+
+ public static final HttpPost createOpenRosaHttpPost(URI uri, String auth) {
+ HttpPost req = new HttpPost(uri);
setOpenRosaHeaders(req);
- req.setURI(uri);
+ setGoogleHeaders(req, auth);
return req;
}
-
- public static final HttpPost createOpenRosaHttpPost(URI uri) {
- HttpPost req = new HttpPost(uri);
- setOpenRosaHeaders(req);
- return req;
- }
-
-
+
public static final HttpClient createHttpClient(int timeout) {
// configure connection
HttpParams params = new BasicHttpParams();
@@ -181,12 +196,11 @@
// setup client
HttpClient httpclient = new DefaultHttpClient(params);
httpclient.getParams().setParameter(ClientPNames.MAX_REDIRECTS, 1);
- httpclient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
+ httpclient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
return httpclient;
}
-
/**
* Common method for returning a parsed xml document given a url and the http context and client
* objects involved in the web connection.
@@ -197,7 +211,7 @@
* @return
*/
public static DocumentFetchResult getXmlDocument(String urlString, HttpContext localContext,
- HttpClient httpclient) {
+ HttpClient httpclient, String auth) {
URI u = null;
try {
URL url = new URL(urlString);
@@ -210,7 +224,7 @@
}
// set up request...
- HttpGet req = WebUtils.createOpenRosaHttpGet(u);
+ HttpGet req = WebUtils.createOpenRosaHttpGet(u, auth);
HttpResponse response = null;
try {