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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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" />
+16 −3
Original line number Diff line number Diff line
@@ -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&eacute;gory Mantelet (CDS;ARI)
 * @version 4.1 (04/2015)
 * @version 4.2 (07/2015)
 */
public class UWSToolBox {

@@ -148,9 +149,21 @@ 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)
					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:
				return map;