@@ -0,0 +1,2255 @@
+/*%0A * $Id: ImageFileFilter.java 3562 2008-05-06 12:46:57Z uckelman $%0A *%0A * Copyright (c) 2008 by Joel Uckelman%0A *%0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Library General Public%0A * License (LGPL) as published by the Free Software Foundation.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Library General Public License for more details.%0A *%0A * You should have received a copy of the GNU Library General Public%0A * License along with this library; if not, copies are available%0A * at http://www.opensource.org.%0A */%0A%0Apackage VASSAL.tools;%0A%0Aimport java.util.Collection;%0Aimport java.util.Iterator;%0A%0A/**%0A * A collection of methods for manipulating %7B@link String%7Ds.%0A *%0A * @author Joel Uckelman%0A * @since 3.1.0%0A */%0Apublic class StringUtils %7B%0A  private StringUtils() %7B%7D%0A%0A  /**%0A   * Joins an array of%7B@link Strings%7D into a single delimiter-separated%0A   * %3Ccode%3EString%3C/code%3E.%0A   *%0A   * @param str the array of %3Ccode%3EString%3C/code%3Es%0A   * @param delim the delimiter to appear between elements of %3Ccode%3Estr%3C/code%3E%0A   * @return a single delimited %3Ccode%3EString%3C/code%3E%0A   */%0A  public static String join(String%5B%5D str, String delim) %7B%0A    if (str == null) return null;%0A    if (str.length == 0) return %22%22;%0A%0A    final StringBuilder sb = new StringBuilder(str%5B0%5D);%0A    for (int i = 1; i %3C str.length; i++) %7B%0A      sb.append(delim).append(str%5Bi%5D);%0A    %7D%0A%0A    return sb.toString();%0A  %7D%0A%0A  /**%0A   * Joins a %7B@link Collection%7D of %7B@link Strings%7D into a single%0A   * delimiter-separated %3Ccode%3EString%3C/code%3E.%0A   *%0A   * @param str the %3Ccode%3ECollection%3C/code%3E of %3Ccode%3EString%3C/code%3Es%0A   * @param delim the delimiter to appear between elements of %3Ccode%3Estr%3C/code%3E%0A   * @return a single delimited %3Ccode%3EString%3C/code%3E%0A   */%0A  public static String join(Collection%3CString%3E str, String delim) %7B%0A    if (str == null) return null;%0A    if (str.size() == 0) return %22%22;%0A%0A    final Iterator%3CString%3E i = str.iterator();%0A    final StringBuilder sb = new StringBuilder(i.next());%0A    %0A    while (i.hasNext()) sb.append(delim).append(i.next());%0A%0A    return sb.toString();%0A  %7D%0A%7D%0A

Adding some useful string methods (like join).