Updated comments and implemented basic log filtering
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user