From 552d7699c6930e2c8ecaea03e425edd8abb0fac2 Mon Sep 17 00:00:00 2001 From: lingutln Date: Mon, 9 Apr 2012 23:05:07 +0000 Subject: [PATCH] Base64 Decoding for UBio webservice. Done by Nikhil. svn path=/; revision=317 --- Annotation/src/ie/dcu/apps/ist/labelling/Labels.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Annotation/src/ie/dcu/apps/ist/labelling/Labels.java b/Annotation/src/ie/dcu/apps/ist/labelling/Labels.java index ea8732f..4a77f4c 100644 --- a/Annotation/src/ie/dcu/apps/ist/labelling/Labels.java +++ b/Annotation/src/ie/dcu/apps/ist/labelling/Labels.java @@ -12,6 +12,7 @@ import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import javax.xml.bind.DatatypeConverter; import javax.xml.parsers.*; import org.w3c.dom.Document; @@ -20,7 +21,6 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; -import org.apache.commons.lang3.StringEscapeUtils; import org.json.JSONArray; import org.json.JSONObject; @@ -82,6 +82,7 @@ public class Labels public Map getLabelsFromXML(String content) { Map map = new HashMap(); + String namBankId,nameBankString; try { String xmlContent = ""; @@ -107,7 +108,9 @@ public class Labels for(int i = 0 ; i < nlist.getLength();i++) { //get the employee element Element el = (Element)nlist.item(i); - map.put(getTagValue("namebankID", el),getTagValue("nameString", el)); + namBankId = new String(DatatypeConverter.parseBase64Binary(getTagValue("namebankID", el))); + nameBankString = new String(DatatypeConverter.parseBase64Binary(getTagValue("nameString", el))); + map.put(namBankId,nameBankString); } } in.close(); -- 2.34.1