Updated comments and implemented basic log filtering

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-09-14 11:54:04 -04:00
parent e6a7798031
commit 7497bc9bbf
10 changed files with 236 additions and 45 deletions

View File

@@ -29,6 +29,11 @@ import org.apache.http.params.HttpProtocolParams;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import android.content.Context;
import com.RickBarrette.osj.forum.Constraints;
import com.RickBarrette.osj.forum.R;
/**
* XMLRPCClient allows to call remote XMLRPC method.
*
@@ -94,7 +99,7 @@ public class XMLRPCClient extends XMLRPCCommon {
public XMLRPCClient(URI uri) {
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("http", new PlainSocketFactory(), 80));
registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
postMethod = new HttpPost(uri);
postMethod.addHeader("Content-Type", "text/xml");
@@ -420,4 +425,17 @@ public class XMLRPCClient extends XMLRPCCommon {
public Object call(String method, Object... params) throws XMLRPCException {
return callEx(method, params);
}
/**
* Creates an XML RPC Client
* @param Context
* @return XMLRPCClient
* @author ricky barrette
*/
public static XMLRPCClient getClient(Context context) {
if(Constraints.TESTING)
return new XMLRPCClient(context.getString(R.string.test_server), context.getString(R.string.test_username), context.getString(R.string.test_password));
else
return new XMLRPCClient(context.getString(R.string.osj_server), context.getString(R.string.test_username), context.getString(R.string.test_password));
}
}