Skip to content
Snippets Groups Projects
Commit c57d2fe4 authored by gmantele's avatar gmantele
Browse files

[UWS] Minor modification: display array parameters properly

in the log output. For that the function UWSToolBox.getParamsMap(...)
had to be modified.
parent fb277b15
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE project> <!DOCTYPE project>
<project name="uws" basedir="." default="buildLib"> <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="srcDir" value="src" />
<property name="libDir" value="lib" /> <property name="libDir" value="lib" />
......
...@@ -26,6 +26,7 @@ import java.io.InputStream; ...@@ -26,6 +26,7 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
...@@ -54,7 +55,7 @@ import uws.service.request.UploadFile; ...@@ -54,7 +55,7 @@ import uws.service.request.UploadFile;
* Some useful functions for the managing of a UWS service. * Some useful functions for the managing of a UWS service.
* *
* @author Gr&eacute;gory Mantelet (CDS;ARI) * @author Gr&eacute;gory Mantelet (CDS;ARI)
* @version 4.1 (04/2015) * @version 4.2 (07/2015)
*/ */
public class UWSToolBox { public class UWSToolBox {
...@@ -148,8 +149,20 @@ public class UWSToolBox { ...@@ -148,8 +149,20 @@ public class UWSToolBox {
// Transform the map of Objects into a map of Strings: // Transform the map of Objects into a map of Strings:
for(Map.Entry<String,Object> e : params.entrySet()){ for(Map.Entry<String,Object> e : params.entrySet()){
if (e.getValue() != null) if (e.getValue() != null){
map.put(e.getKey(), e.getValue().toString()); 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: // Return the fetched map:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment