diff --git a/buildUWS.xml b/buildUWS.xml index d6ddd7f9bdb01ff997106ad8b4b90829498543ee..2f1a9fbc183d759dec236c3c4d87136b95eb3b6a 100644 --- a/buildUWS.xml +++ b/buildUWS.xml @@ -2,7 +2,7 @@ <!DOCTYPE project> <project name="uws" basedir="." default="buildLib"> - <property name="version" value="4.1" /> + <property name="version" value="4.2" /> <property name="srcDir" value="src" /> <property name="libDir" value="lib" /> diff --git a/src/uws/UWSToolBox.java b/src/uws/UWSToolBox.java index 34bb1556a57cdadd65f2ac294de619bd3c5c03ba..e622c560606604c91d675d3cb420667775ce8eaf 100644 --- a/src/uws/UWSToolBox.java +++ b/src/uws/UWSToolBox.java @@ -26,6 +26,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; +import java.lang.reflect.Array; import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; @@ -54,7 +55,7 @@ import uws.service.request.UploadFile; * Some useful functions for the managing of a UWS service. * * @author Grégory Mantelet (CDS;ARI) - * @version 4.1 (04/2015) + * @version 4.2 (07/2015) */ public class UWSToolBox { @@ -148,8 +149,20 @@ public class UWSToolBox { // Transform the map of Objects into a map of Strings: for(Map.Entry<String,Object> e : params.entrySet()){ - if (e.getValue() != null) - map.put(e.getKey(), e.getValue().toString()); + if (e.getValue() != null){ + if (e.getValue().getClass().isArray()){ + StringBuffer str = new StringBuffer(); + Object array = e.getValue(); + int length = Array.getLength(array); + for(int i = 0; i < length; i++){ + if (i > 0) + str.append(';'); + str.append(Array.get(array, i)); + } + map.put(e.getKey(), str.toString()); + }else + map.put(e.getKey(), e.getValue().toString()); + } } // Return the fetched map: