diff options
Diffstat (limited to 'client/trunk/src/com/fourisland/instadisc/XmlRpc.java')
-rw-r--r-- | client/trunk/src/com/fourisland/instadisc/XmlRpc.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/client/trunk/src/com/fourisland/instadisc/XmlRpc.java b/client/trunk/src/com/fourisland/instadisc/XmlRpc.java index 8c22155..4fe5b4b 100644 --- a/client/trunk/src/com/fourisland/instadisc/XmlRpc.java +++ b/client/trunk/src/com/fourisland/instadisc/XmlRpc.java | |||
@@ -23,14 +23,11 @@ public class XmlRpc { | |||
23 | private String function; | 23 | private String function; |
24 | private Object[] params; | 24 | private Object[] params; |
25 | private int step = 3; | 25 | private int step = 3; |
26 | private String url = ""; | 26 | private String url; |
27 | 27 | ||
28 | public XmlRpc(String function) { | 28 | public XmlRpc(String function) { |
29 | this.function = function; | 29 | this.function = function; |
30 | if (url.equals("")) | 30 | this.url = "http://central.fourisland.com/xmlrpc.php"; |
31 | { | ||
32 | url = Wrapper.getConfig("centralServerURL"); | ||
33 | } | ||
34 | 31 | ||
35 | Verification ver = new Verification(); | 32 | Verification ver = new Verification(); |
36 | params = new Object[3]; | 33 | params = new Object[3]; |
@@ -39,11 +36,21 @@ public class XmlRpc { | |||
39 | params[2] = ver.getID(); | 36 | params[2] = ver.getID(); |
40 | } | 37 | } |
41 | 38 | ||
42 | public XmlRpc(String function, String url, String username, String password) | 39 | public XmlRpc(String url, String function) { |
43 | { | ||
44 | this.function = function; | 40 | this.function = function; |
45 | this.url = url; | 41 | this.url = url; |
46 | 42 | ||
43 | Verification ver = new Verification(); | ||
44 | params = new Object[3]; | ||
45 | params[0] = ver.getUsername(); | ||
46 | params[1] = ver.getHash(); | ||
47 | params[2] = ver.getID(); | ||
48 | } | ||
49 | |||
50 | public XmlRpc(String function, String username, String password) | ||
51 | { | ||
52 | this.function = function; | ||
53 | |||
47 | Verification ver = new Verification(username, password); | 54 | Verification ver = new Verification(username, password); |
48 | params = new Object[3]; | 55 | params = new Object[3]; |
49 | params[0] = ver.getUsername(); | 56 | params[0] = ver.getUsername(); |
@@ -69,7 +76,7 @@ public class XmlRpc { | |||
69 | Object result = null; | 76 | Object result = null; |
70 | try { | 77 | try { |
71 | XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); | 78 | XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); |
72 | config.setServerURL(new URL(url)); | 79 | config.setServerURL(new URL("http://central.fourisland.com/xmlrpc.php")); |
73 | XmlRpcClient client = new XmlRpcClient(); | 80 | XmlRpcClient client = new XmlRpcClient(); |
74 | client.setConfig(config); | 81 | client.setConfig(config); |
75 | 82 | ||