return returnDate.toString();
}
+ /**
+ * Splits the provided CSV text into a list. stolen wholesale from
+ * from Jakarta Turbine StrinUtils.java -mh
+ *
+ * @param text The CSV list of values to split apart.
+ * @param separator The separator character.
+ * @return The list of values.
+ */
+ public static String[] split(String text, String separator)
+ {
+ StringTokenizer st = new StringTokenizer(text, separator);
+ String[] values = new String[st.countTokens()];
+ int pos = 0;
+ while (st.hasMoreTokens())
+ {
+ values[pos++] = st.nextToken();
+ }
+ return values;
+ }
+
+ /**
+ * Joins the elements of the provided array into a single string
+ * containing a list of CSV elements. Stolen wholesale from Jakarta
+ * Turbine StringUtils.java. -mh
+ *
+ * @param list The list of values to join together.
+ * @param separator The separator character.
+ * @return The CSV text.
+ */
+ public static String join(String[] list, String separator)
+ {
+ StringBuffer csv = new StringBuffer();
+ for (int i = 0; i < list.length; i++)
+ {
+ if (i > 0)
+ {
+ csv.append(separator);
+ }
+ csv.append(list[i]);
+ }
+ return csv.toString();
+ }
+
/**
* schließt einen String in Anführungsszeichen ein, falls er Leerzeichen o.ä. enthält
* @param width, width of the image
* @return a String containing the url
*/
- public static String createIMGLinks(String haystack, String title, String height,String width) {
+ public static String createIMGLinks(String haystack, String title,
+ String height,String width) {
+ String wh="";
+ if ( (height != null) && (width != null) )
+ {
+ wh = "width=\""+width+"\" height=\""+height+"\"";
+ }
if (title != null) {
title = removeHTMLTags(title);
- return re_url.substituteAll(haystack,"<img hspace=\"10\" vspace=\"6\" align=\"left\" src=\"$0\" width=\""+width+"\" height=\""+height+"\" alt=\""+title+"\"/> <br><i>"+title+"</i>");
+ return re_url.substituteAll(haystack,
+ "<img hspace=\"10\" vspace=\"6\" "+
+ "align=\"left\" src=\"$0\" "+wh+
+ " alt=\""+title+"\"/> <br><i>"+
+ title+"</i>");
} else {
- return re_url.substituteAll(haystack,"<img hspace=\"10\" vspace=\"6\" align=\"left\" src=\"$0\" width=\""+width+"\" height=\""+height+"\" alt=\"\"/> ");
+ return re_url.substituteAll(haystack,
+ "<img hspace=\"10\" vspace=\"6\" "+
+ "align=\"left\" src=\"$0\" "+wh+
+ " alt=\"\"/> ");
}
}