+\r
+\r
+ /**\r
+ * Logs an exception triggered in a HTTP request. \r
+ * \r
+ * @param e Caught exception.\r
+ * @param doing Suffix to add at the end of the logged message.\r
+ */\r
+ private void logException(Exception e, String doing) {\r
+ if (e instanceof HttpException) {\r
+ Log.e(TAG, "HTTP violation while " + doing, e);\r
+\r
+ } else if (e instanceof IOException) {\r
+ Log.e(TAG, "Unrecovered transport exception while " + doing, e);\r
+\r
+ } else {\r
+ Log.e(TAG, "Unexpected exception while " + doing, e);\r
+ }\r
+ }\r
+\r
+ \r
+ /**\r
+ * Sets the connection and wait-for-data timeouts to be applied by default to the methods performed by this client.\r
+ */\r
+ public void setDefaultTimeouts(int defaultDataTimeout, int defaultConnectionTimeout) {\r
+ getParams().setSoTimeout(defaultDataTimeout);\r
+ getHttpConnectionManager().getParams().setConnectionTimeout(defaultConnectionTimeout);\r
+ }\r
+\r
+ /**\r
+ * Sets the base URI for the helper methods that receive paths as parameters, instead of full URLs\r
+ * @param uri\r
+ */\r
+ public void setBaseUri(Uri uri) {\r
+ mUri = uri;\r
+ }\r
+\r
+ public Uri getBaseUri() {\r
+ return mUri;\r
+ }\r
+\r