added one more utility method.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3520 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-06-23 16:56:11 +00:00
1 parent 192458c19d
commit 07f4117582
1 file changed
+15 -1
+15 -1
View File
@@ -498,6 +498,21 @@ public class Util {
return filePath;
}
/**
* Concatenate multiple strings by inserting a separator.
*/
public static String join(Collection<String> strings, String seprator) {
StringBuilder buf = new StringBuilder();
boolean first=true;
for (String s : strings) {
if(first) first=false;
else buf.append(seprator);
buf.append(s);
}
return buf.toString();
}
public static final SimpleDateFormat XS_DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
// Note: RFC822 dates must not be localized!
@@ -511,5 +526,4 @@ public class Util {
private static final Logger LOGGER = Logger.getLogger(Util.class.getName());
}