[Yanel-commits] rev 28104 - public/yanel/trunk/src/core/java/org/wyona/yanel/core

josias at wyona.com josias at wyona.com
Thu Oct 25 10:03:09 CEST 2007


Author: josias
Date: 2007-10-25 10:03:09 +0200 (Thu, 25 Oct 2007)
New Revision: 28104

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/Resource.java
Log:
getParameterAsString(): if the parameter is a string array, return the first value

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/Resource.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/Resource.java	2007-10-25 07:59:24 UTC (rev 28103)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/Resource.java	2007-10-25 08:03:09 UTC (rev 28104)
@@ -208,6 +208,7 @@
 
     /**
      * Gets the parameter with the given name as a string.
+     * If the parameter is a string array, returns the first string.
      * @param name
      * @return parameter string or null if no parameter with this name exists.
      */
@@ -216,7 +217,11 @@
         if (param == null) {
             return null;
         } else {
-            return param.toString();
+            if (param instanceof String[]) {
+                return ((String [])param)[0];
+            } else {
+                return param.toString();
+            }
         }
     }
 



More information about the Yanel-commits mailing list