aboutsummaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2012-11-21 12:37:50 +0000
committerDamian Minkov <damencho@jitsi.org>2012-11-21 12:37:50 +0000
commit4f3d81f0ccdecc7528114f7470a0c2749a908982 (patch)
treedbd764bc0263ec724bf77c78a938a946a07368f8 /src/net
parente2ef092f63761dccd574e0b10b9e6f0f06bc852d (diff)
downloadjitsi-4f3d81f0ccdecc7528114f7470a0c2749a908982.zip
jitsi-4f3d81f0ccdecc7528114f7470a0c2749a908982.tar.gz
jitsi-4f3d81f0ccdecc7528114f7470a0c2749a908982.tar.bz2
Replaces json lib.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/java/sip/communicator/impl/libjitsi/libjitsi.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/ServerStoredContactListXivoImpl.java92
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java11
-rw-r--r--src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java21
-rw-r--r--src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java11
-rw-r--r--src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java14
-rw-r--r--src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java11
-rw-r--r--src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/plugin/ippiaccregwizz/CreateIppiAccountForm.java11
-rw-r--r--src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf2
-rw-r--r--src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java17
-rw-r--r--src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf6
18 files changed, 113 insertions, 99 deletions
diff --git a/src/net/java/sip/communicator/impl/libjitsi/libjitsi.manifest.mf b/src/net/java/sip/communicator/impl/libjitsi/libjitsi.manifest.mf
index 6f5b7c6..1759b80 100644
--- a/src/net/java/sip/communicator/impl/libjitsi/libjitsi.manifest.mf
+++ b/src/net/java/sip/communicator/impl/libjitsi/libjitsi.manifest.mf
@@ -55,7 +55,7 @@ Import-Package: apple.awt,
org.bouncycastle.crypto.params,
org.bouncycastle.crypto.prng,
org.ice4j.socket,
- org.json,
+ org.json.simple,
org.osgi.framework,
org.w3c.dom,
org.xml.sax,
diff --git a/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf b/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf
index 510e37f..1533115 100644
--- a/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf
+++ b/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf
@@ -61,7 +61,7 @@ Import-Package: apple.awt,
org.jitsi.util,
org.jitsi.util.event,
org.jitsi.util.swing,
- org.json,
+ org.json.simple,
org.osgi.framework,
org.w3c.dom,
org.xml.sax,
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ServerStoredContactListXivoImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/ServerStoredContactListXivoImpl.java
index 751e852..031c108 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/ServerStoredContactListXivoImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/ServerStoredContactListXivoImpl.java
@@ -22,7 +22,7 @@ import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
import org.jitsi.util.*;
-import org.json.*;
+import org.json.simple.*;
/**
* Xivo server stored contact list. Currently no modifications are possible.
@@ -250,9 +250,9 @@ public class ServerStoredContactListXivoImpl
if(logger.isTraceEnabled())
logger.trace("Read from server:" + line);
- handle(new JSONObject(line));
+ handle((JSONObject)JSONValue.parseWithException(line));
}
- catch(JSONException ex)
+ catch(Throwable ex)
{
logger.error("Error parsing object:" + line, ex);
}
@@ -471,21 +471,21 @@ public class ServerStoredContactListXivoImpl
*/
private void handle(JSONObject incomingObject)
{
- if(!incomingObject.has("class"))
+ if(!incomingObject.containsKey("class"))
return;
try
{
- String classField = incomingObject.getString("class");
+ String classField = (String)incomingObject.get("class");
if (classField.equals("loginko"))
{
showError(null, null,
"Unauthorized. Cannot login: " +
- incomingObject.getString("errorstring"));
+ incomingObject.get("errorstring"));
logger.error("Error login: " +
- incomingObject.getString("errorstring"));
+ incomingObject.get("errorstring"));
destroy();
@@ -508,22 +508,22 @@ public class ServerStoredContactListXivoImpl
password = accountID.getAccountPropertyString(XIVO_PASSWORD);
}
- if(!authorize(incomingObject.getString("sessionid"), password))
+ if(!authorize((String)incomingObject.get("sessionid"), password))
logger.error("Error login authorization!");
return;
}
else if (classField.equals("login_pass_ok"))
{
- if(!sendCapas(incomingObject.getJSONArray("capalist")))
+ if(!sendCapas((JSONArray)incomingObject.get("capalist")))
logger.error("Error send capas!");
return;
}
else if (classField.equals("login_capas_ok"))
{
- if(!sendFeatures(incomingObject.getString("astid"),
- incomingObject.getString("xivo_userid")))
+ if(!sendFeatures((String)incomingObject.get("astid"),
+ (String)incomingObject.get("xivo_userid")))
logger.error("Problem send features get!");
return;
@@ -563,27 +563,29 @@ public class ServerStoredContactListXivoImpl
* @param username the username.
* @return is command successful.
*/
+ @SuppressWarnings("unchecked")
private boolean login(String username)
{
if(connection == null || username == null)
return false;
+
JSONObject obj = new JSONObject();
try
{
- obj.accumulate("class","login_id");
- obj.accumulate("company", "Jitsi");
+ obj.put("class","login_id");
+ obj.put("company", "Jitsi");
String os = "x11";
if(OSUtils.IS_WINDOWS)
os = "win";
else if(OSUtils.IS_MAC)
os = "mac";
- obj.accumulate("ident", username + "@" + os);
+ obj.put("ident", username + "@" + os);
- obj.accumulate("userid", username);
- obj.accumulate("version", "9999");
- obj.accumulate("xivoversion", "1.1");
+ obj.put("userid", username);
+ obj.put("version", "9999");
+ obj.put("xivoversion", "1.1");
return send(obj);
}
@@ -600,6 +602,7 @@ public class ServerStoredContactListXivoImpl
* @param password the password to authorize.
* @return is command successful.
*/
+ @SuppressWarnings("unchecked")
private boolean authorize(String sessionId, String password)
{
if(connection == null || sessionId == null || password == null)
@@ -608,8 +611,8 @@ public class ServerStoredContactListXivoImpl
JSONObject obj = new JSONObject();
try
{
- obj.accumulate("class","login_pass");
- obj.accumulate("hashedpassword",
+ obj.put("class","login_pass");
+ obj.put("hashedpassword",
Sha1Crypto.encode(sessionId + ":" + password));
return send(obj);
@@ -626,20 +629,21 @@ public class ServerStoredContactListXivoImpl
* @param capalistParam param from previous command.
* @return is command successful.
*/
+ @SuppressWarnings("unchecked")
private boolean sendCapas(JSONArray capalistParam)
{
if(connection == null
- || capalistParam == null || capalistParam.length() < 1)
+ || capalistParam == null || capalistParam.isEmpty())
return false;
JSONObject obj = new JSONObject();
try
{
- obj.accumulate("class", "login_capas");
- obj.accumulate("capaid", capalistParam.getString(0));
- obj.accumulate("lastconnwins", "false");
- obj.accumulate("loginkind", "agent");
- obj.accumulate("state", "");
+ obj.put("class", "login_capas");
+ obj.put("capaid", capalistParam.get(0));
+ obj.put("lastconnwins", "false");
+ obj.put("loginkind", "agent");
+ obj.put("state", "");
return send(obj);
}
@@ -656,6 +660,7 @@ public class ServerStoredContactListXivoImpl
* @param xivoUserId param from previous command.
* @return is command successful.
*/
+ @SuppressWarnings("unchecked")
private boolean sendFeatures(String astid, String xivoUserId)
{
if(connection == null || astid == null || xivoUserId == null)
@@ -664,8 +669,8 @@ public class ServerStoredContactListXivoImpl
JSONObject obj = new JSONObject();
try
{
- obj.accumulate("class","featuresget");
- obj.accumulate("userid", astid + "/" + xivoUserId);
+ obj.put("class","featuresget");
+ obj.put("userid", astid + "/" + xivoUserId);
return send(obj);
}
@@ -680,13 +685,14 @@ public class ServerStoredContactListXivoImpl
* Sends command to retrieve phones list.
* @return is command successful.
*/
+ @SuppressWarnings("unchecked")
private boolean getPhoneList()
{
JSONObject obj = new JSONObject();
try
{
- obj.accumulate("class", "phones");
- obj.accumulate("function", "getlist");
+ obj.put("class", "phones");
+ obj.put("function", "getlist");
return send(obj);
}
@@ -722,20 +728,20 @@ public class ServerStoredContactListXivoImpl
{
try
{
- if(!objReceived.getString("function").equals("sendlist")
- || !objReceived.has("payload"))
+ if(!objReceived.get("function").equals("sendlist")
+ || !objReceived.containsKey("payload"))
return;
- JSONObject payload = objReceived.getJSONObject("payload");
- Iterator iter = payload.keys();
+ JSONObject payload = (JSONObject)objReceived.get("payload");
+ Iterator iter = payload.keySet().iterator();
List<JSONObject> phoneList = new ArrayList<JSONObject>();
while(iter.hasNext())
{
- JSONObject obj = (JSONObject)payload.get((String) iter.next());
- Iterator phonesIter = obj.keys();
+ JSONObject obj = (JSONObject)payload.get(iter.next());
+ Iterator phonesIter = obj.keySet().iterator();
while(phonesIter.hasNext())
phoneList.add(
- (JSONObject)obj.get((String)phonesIter.next()));
+ (JSONObject)obj.get(phonesIter.next()));
}
@@ -744,10 +750,10 @@ public class ServerStoredContactListXivoImpl
try
{
// don't handle non sip phones
- if(!phone.getString("tech").equalsIgnoreCase("sip"))
+ if(!((String)phone.get("tech")).equalsIgnoreCase("sip"))
continue;
- String groupName = phone.getString("context");
+ String groupName = (String)phone.get("context");
ContactGroupSipImpl parentGroup =
findGroupByName(groupName);
@@ -763,7 +769,7 @@ public class ServerStoredContactListXivoImpl
ServerStoredGroupEvent.GROUP_CREATED_EVENT);
}
- String number = phone.getString("number");
+ String number = (String)phone.get("number");
Address address =
sipProvider.parseAddressString(number);
@@ -776,8 +782,8 @@ public class ServerStoredContactListXivoImpl
{
contact = new ContactSipImpl(address, sipProvider);
contact.setDisplayName(
- phone.getString("firstname") + " "
- + phone.getString("lastname"));
+ phone.get("firstname") + " "
+ + phone.get("lastname"));
contact.setResolved(true);
parentGroup.addContact(contact);
@@ -786,8 +792,8 @@ public class ServerStoredContactListXivoImpl
else
{
contact.setDisplayName(
- phone.getString("firstname") + " "
- + phone.getString("lastname"));
+ phone.get("firstname") + " "
+ + phone.get("lastname"));
contact.setResolved(true);
fireContactResolved(parentGroup, contact);
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf
index 4d7a9db..4c674e9 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf
+++ b/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf
@@ -66,7 +66,7 @@ Import-Package: ch.imvs.sdes4j.srtp,
org.jitsi.service.version,
org.jitsi.util,
org.jitsi.util.xml,
- org.json,
+ org.json.simple,
org.osgi.framework,
org.w3c.dom,
org.xml.sax
diff --git a/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java b/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java
index 3534c26..87ad46d 100644
--- a/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java
+++ b/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java
@@ -11,7 +11,7 @@ import java.net.*;
import net.java.sip.communicator.service.replacement.*;
import net.java.sip.communicator.util.*;
-import org.json.*;
+import org.json.simple.*;
/**
* Implements the {@link ReplacementService} to provide previews for Blip.tv
@@ -78,18 +78,19 @@ public class ReplacementServiceBliptvImpl
holder += inputLine;
in.close();
- JSONObject wrapper = new JSONObject(holder);
+ JSONObject wrapper = (JSONObject)JSONValue
+ .parseWithException(holder);
- String thumbUrl = wrapper.getString("thumbnail_url");
+ String thumbUrl = (String)wrapper.get("thumbnail_url");
if (thumbUrl != null)
{
return thumbUrl;
}
}
- catch (Exception e)
+ catch (Throwable e)
{
- e.printStackTrace();
+ logger.error("Error parsing", e);
}
return sourceString;
diff --git a/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf
index fd9d815..bc6022d 100644
--- a/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf
+++ b/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf
@@ -10,4 +10,4 @@ Import-Package: org.osgi.framework,
org.jitsi.service.resources, net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
org.apache.http,
- org.json
+ org.json.simple
diff --git a/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java b/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java
index 80b5767..d7ba5d0 100644
--- a/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java
+++ b/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java
@@ -12,7 +12,7 @@ import java.util.regex.*;
import net.java.sip.communicator.service.replacement.*;
import net.java.sip.communicator.util.*;
-import org.json.*;
+import org.json.simple.*;
/**
* Implements the {@link ReplacementService} to provide previews for Flickr
@@ -99,16 +99,17 @@ public class ReplacementServiceFlickrImpl
holder = inputLine;
in.close();
- JSONObject wrapper = new JSONObject(holder);
+ JSONObject wrapper = (JSONObject)JSONValue
+ .parseWithException(holder);
- if (wrapper.getString("stat").equals("ok"))
+ if (wrapper.get("stat").equals("ok"))
{
- JSONObject result = wrapper.getJSONObject("photo");
- if (!(result.length() == 0))
+ JSONObject result = (JSONObject)wrapper.get("photo");
+ if (!(result.isEmpty()))
{
- String farmID = result.getString("farm");
- String serverID = result.getString("server");
- String secret = result.getString("secret");
+ String farmID = (String)result.get("farm");
+ String serverID = (String)result.get("server");
+ String secret = (String)result.get("secret");
thumbUrl =
"http://farm" + farmID + ".static.flickr.com/"
@@ -117,9 +118,9 @@ public class ReplacementServiceFlickrImpl
}
}
}
- catch(Exception e)
+ catch(Throwable e)
{
- e.printStackTrace();
+ logger.error("Error parsing", e);
}
}
diff --git a/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf
index 231f495..700e2c6 100644
--- a/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf
+++ b/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf
@@ -10,4 +10,4 @@ Import-Package: org.osgi.framework,
org.jitsi.service.resources, net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
org.apache.http,
- org.json
+ org.json.simple
diff --git a/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java b/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java
index ca68452..8a39778 100644
--- a/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java
+++ b/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java
@@ -11,7 +11,7 @@ import java.net.*;
import net.java.sip.communicator.service.replacement.*;
import net.java.sip.communicator.util.*;
-import org.json.*;
+import org.json.simple.*;
/**
* Implements the {@link ReplacementService} to provide previews for Hulu links.
@@ -76,18 +76,19 @@ public class ReplacementServiceHuluImpl
holder = inputLine;
in.close();
- JSONObject wrapper = new JSONObject(holder);
+ JSONObject wrapper = (JSONObject)JSONValue
+ .parseWithException(holder);
- String thumbUrl = wrapper.getString("thumbnail_url");
+ String thumbUrl = (String)wrapper.get("thumbnail_url");
if (thumbUrl != null)
{
return thumbUrl;
}
}
- catch (Exception e)
+ catch (Throwable e)
{
- e.printStackTrace();
+ logger.error("Error parsing", e);
}
return sourceString;
diff --git a/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf
index b50cd0d..e7e91f7 100644
--- a/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf
+++ b/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf
@@ -10,4 +10,4 @@ Import-Package: org.osgi.framework,
org.jitsi.service.resources, net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
org.apache.http,
- org.json
+ org.json.simple
diff --git a/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java b/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java
index ddafaa4..a4cfc94 100644
--- a/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java
+++ b/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java
@@ -12,7 +12,7 @@ import java.util.regex.*;
import net.java.sip.communicator.service.replacement.*;
import net.java.sip.communicator.util.*;
-import org.json.*;
+import org.json.simple.*;
/**
* Implements the {@link ReplacementService} to provide previews for Vimeo
@@ -88,17 +88,19 @@ public class ReplacementServiceVimeoImpl
holder = inputLine;
in.close();
- JSONArray result = new JSONArray(holder);
+ JSONArray result = (JSONArray)JSONValue
+ .parseWithException(holder);
- if (!(result.length() == 0))
+ if (!(result.isEmpty()))
{
thumbUrl
- = result.getJSONObject(0).getString("thumbnail_medium");
+ = (String)((JSONObject)result.get(0))
+ .get("thumbnail_medium");
}
}
- catch (Exception e)
+ catch (Throwable e)
{
- e.printStackTrace();
+ logger.error("Error parsing", e);
}
}
diff --git a/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf
index 019f275..b9865e1 100644
--- a/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf
+++ b/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf
@@ -10,4 +10,4 @@ Import-Package: org.osgi.framework,
org.jitsi.service.resources, net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
org.apache.http,
- org.json
+ org.json.simple
diff --git a/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java b/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java
index 8201714..6081089 100644
--- a/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java
+++ b/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java
@@ -11,7 +11,7 @@ import java.net.*;
import net.java.sip.communicator.service.replacement.*;
import net.java.sip.communicator.util.*;
-import org.json.*;
+import org.json.simple.*;
/**
* Implements the {@link ReplacementService} to provide previews for Youtube
@@ -76,18 +76,19 @@ public class ReplacementServiceYoutubeImpl
holder = inputLine;
in.close();
- JSONObject wrapper = new JSONObject(holder);
+ JSONObject wrapper = (JSONObject)JSONValue
+ .parseWithException(holder);
- String thumbUrl = wrapper.getString("thumbnail_url");
+ String thumbUrl = (String)wrapper.get("thumbnail_url");
if (thumbUrl != null)
{
return thumbUrl;
}
}
- catch (Exception e)
+ catch (Throwable e)
{
- e.printStackTrace();
+ logger.error("Error parsing", e);
}
return sourceString;
diff --git a/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf
index fabe198..622cc39 100644
--- a/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf
+++ b/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf
@@ -10,4 +10,4 @@ Import-Package: org.osgi.framework,
org.jitsi.service.resources, net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
org.apache.http,
- org.json
+ org.json.simple
diff --git a/src/net/java/sip/communicator/plugin/ippiaccregwizz/CreateIppiAccountForm.java b/src/net/java/sip/communicator/plugin/ippiaccregwizz/CreateIppiAccountForm.java
index f7179b8..cb454d1 100644
--- a/src/net/java/sip/communicator/plugin/ippiaccregwizz/CreateIppiAccountForm.java
+++ b/src/net/java/sip/communicator/plugin/ippiaccregwizz/CreateIppiAccountForm.java
@@ -19,7 +19,7 @@ import net.java.sip.communicator.plugin.sipaccregwizz.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
-import org.json.*;
+import org.json.simple.*;
/**
* @author Yana Stamcheva
@@ -281,8 +281,9 @@ public class CreateIppiAccountForm
NewAccount newAccount = null;
try
{
- JSONObject jsonObject = new JSONObject(response);
- boolean isSuccess = jsonObject.getBoolean("success");
+ JSONObject jsonObject = (JSONObject)JSONValue
+ .parseWithException(response);
+ boolean isSuccess = (Boolean)jsonObject.get("success");
if (isSuccess)
{
@@ -294,10 +295,10 @@ public class CreateIppiAccountForm
}
else
{
- showErrorMessage(jsonObject.getString("error_message"));
+ showErrorMessage((String)jsonObject.get("error_message"));
}
}
- catch (JSONException e1)
+ catch (Throwable e1)
{
if (logger.isInfoEnabled())
logger.info("Failed Json parsing.", e1);
diff --git a/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf
index 3447966..941c07e 100644
--- a/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf
+++ b/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf
@@ -24,7 +24,7 @@ Import-Package: org.osgi.framework,
javax.xml.parsers,
org.w3c.dom,
org.xml.sax,
- org.json,
+ org.json.simple,
javax.swing,
javax.swing.event,
javax.swing.table,
diff --git a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java
index 5af290e..5533fb2 100644
--- a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java
+++ b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/CreateSip2SipAccountForm.java
@@ -19,7 +19,7 @@ import net.java.sip.communicator.plugin.sipaccregwizz.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
-import org.json.*;
+import org.json.simple.*;
/**
* @author Yana Stamcheva
@@ -304,18 +304,19 @@ public class CreateSip2SipAccountForm
NewAccount newAccount = null;
try
{
- JSONObject jsonObject = new JSONObject(response);
- boolean isSuccess = jsonObject.getBoolean("success");
+ JSONObject jsonObject = (JSONObject)JSONValue
+ .parseWithException(response);
+ boolean isSuccess = (Boolean)jsonObject.get("success");
if (isSuccess)
{
newAccount = new NewAccount(
- jsonObject.getString("sip_address"),
+ (String)jsonObject.get("sip_address"),
passField.getPassword(),
null,
- jsonObject.getString("outbound_proxy"));
+ (String)jsonObject.get("outbound_proxy"));
- String xcapRoot = jsonObject.getString("xcap_root");
+ String xcapRoot = (String)jsonObject.get("xcap_root");
// as sip2sip adds @sip2sip.info at the end of the
// xcap_uri but doesn't report it in resullt after
@@ -340,10 +341,10 @@ public class CreateSip2SipAccountForm
}
else
{
- showErrorMessage(jsonObject.getString("error_message"));
+ showErrorMessage((String)jsonObject.get("error_message"));
}
}
- catch (JSONException e1)
+ catch (Throwable e1)
{
if (logger.isInfoEnabled())
logger.info("Failed Json parsing.", e1);
diff --git a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf
index 98f186f..a4a0c6c 100644
--- a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf
+++ b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf
@@ -17,14 +17,14 @@ Import-Package: org.osgi.framework,
net.java.sip.communicator.service.protocol.icqconstants,
org.jitsi.service.resources, net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
- net.java.sip.communicator.util.swing,
+ net.java.sip.communicator.util.swing,
net.java.sip.communicator.plugin.sipaccregwizz,
javax.naming,
javax.naming.directory,
javax.xml.parsers,
org.w3c.dom,
- org.xml.sax,
- org.json,
+ org.xml.sax,
+ org.json.simple,
javax.swing,
javax.swing.event,
javax.swing.table,