From 4bdd3958a1d1167063acdf3a0cca49ac56b8e446 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 28 Feb 2014 17:55:22 -0500 Subject: [PATCH] Add flatten string array to StringUtils --- src/main/java/com/gitblit/utils/StringUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/gitblit/utils/StringUtils.java b/src/main/java/com/gitblit/utils/StringUtils.java index 8a2af070..5813c3ae 100644 --- a/src/main/java/com/gitblit/utils/StringUtils.java +++ b/src/main/java/com/gitblit/utils/StringUtils.java @@ -137,6 +137,18 @@ public class StringUtils { return retStr.toString(); } + /** + * Flatten the list of strings into a single string with the specified + * separator. + * + * @param values + * @param separator + * @return flattened list + */ + public static String flattenStrings(String[] values, String separator) { + return flattenStrings(Arrays.asList(values), separator); + } + /** * Flatten the list of strings into a single string with a space separator. * -- 2.39.5