airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1516303 - /airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/StringUtil.java
Date Wed, 21 Aug 2013 21:05:37 GMT
Author: lahiru
Date: Wed Aug 21 21:05:36 2013
New Revision: 1516303

URL: http://svn.apache.org/r1516303
Log:
adding new methods to string util to return a merging string from an arrya.

Modified:
    airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/StringUtil.java

Modified: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/StringUtil.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/StringUtil.java?rev=1516303&r1=1516302&r2=1516303&view=diff
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/StringUtil.java
(original)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/StringUtil.java
Wed Aug 21 21:05:36 2013
@@ -46,32 +46,52 @@ public class StringUtil {
 	 * @param list
 	 * @return
 	 */
-	public static String createDelimiteredString(String[] list){
+	public static String createDelimiteredString(String[] list) {
+        return createDelimiteredString(list, DELIMETER);
+    }
+
+
+    /**
+	 * Create a delimiter separated string out of a list
+	 * @param list
+	 * @return
+	 */
+	public static String createDelimiteredString(String[] list,String delimeter){
 		String s=null;
 		for (String ss : list) {
 			ss=quoteString(ss);
 			if (s==null){
 				s=ss;
 			}else{
-				s+=DELIMETER +ss;
+				s+=delimeter +ss;
 			}
 		}
 		return s;
 	}
-	
+
 	/**
 	 * Return a proper quoted string if the string contains the delimiter character
 	 * @param s
 	 * @return
 	 */
-	public static String quoteString(String s){
+	public static String quoteString(String s) {
+        return quoteString(s, DELIMETER);
+    }
+
+
+    /**
+	 * Return a proper quoted string if the string contains the delimiter character
+	 * @param s
+	 * @return
+	 */
+	public static String quoteString(String s,String delimeter){
 		if (isQuoted(s)){
 			return s;
 		}else{
 			return QUOTE+s+QUOTE;
 		}
 	}
-	
+
 	/**
 	 * Parse the delimitered string and return elements as a string array 
 	 * @param s



Mime
View raw message