From 0cb7ded87955286f950d2802fc6a0d1c9c26726a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Wed, 15 Jan 2020 04:44:54 +0100 Subject: Add setting contacts in a fetcher flag --- .../java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/client') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java index 5f34fe9..f147b2a 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -133,9 +133,9 @@ public class ClientController { return "contactsForm"; } - private Set parseContactsString(DataStringInput contactsInput) throws Exception { + public static Set parseContactsString(String contactsInput) throws Exception { Gson gson = new Gson(); - Map contactStrings = gson.fromJson(contactsInput.getString(), Map.class); + Map contactStrings = gson.fromJson(contactsInput, Map.class); Set contactObjects = new HashSet(); ArrayList cAddr; byte[] inetArray = new byte[4]; @@ -160,7 +160,7 @@ public class ClientController { Set contactObjects; try { - contactObjects = parseContactsString(contactsObject); + contactObjects = parseContactsString(contactsObject.getString()); this.agentApi.setFallbackContacts(contactObjects); } catch (Exception e) { success = false; @@ -263,7 +263,7 @@ public class ClientController { case "Contact": DataStringInput contactsString = new DataStringInput(); contactsString.setString(attributeObject.getValueString()); - attributeValue = parseContactsString(contactsString).iterator().next(); + attributeValue = parseContactsString(contactsString.getString()).iterator().next(); break; case "List": List parsedListValue = gson.fromJson(attributeObject.getValueString(), List.class); -- cgit v1.2.3