2 * Copyright (C) 2001, 2002 The Mir-coders group
4 * This file is part of Mir.
6 * Mir is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Mir is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Mir; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * In addition, as a special exception, The Mir-coders gives permission to link
21 * the code of this program with the com.oreilly.servlet library, any library
22 * licensed under the Apache Software License, The Sun (tm) Java Advanced
23 * Imaging library (JAI), The Sun JIMI library (or with modified versions of
24 * the above that use the same license as the above), and distribute linked
25 * combinations including the two. You must obey the GNU General Public
26 * License in all respects for all of the code used other than the above
27 * mentioned libraries. If you modify this file, you may extend this exception
28 * to your version of the file, but you are not obligated to do so. If you do
29 * not wish to do so, delete this exception statement from your version.
37 import java.text.NumberFormat;
41 * Statische Hilfsmethoden zur Stringbehandlung
43 * @version $Id: StringUtil.java,v 1.23.2.3 2002/12/09 06:23:38 mh Exp $
44 * @author rk, mir-coders group
48 public final class StringUtil {
50 private static RE re_newline2br, re_brbr2p, re_mail, re_url, re_tags;
52 private StringUtil() { } // this avoids contruction
57 re_newline2br = new RE("(\r?\n){1}");
58 re_brbr2p = new RE("(<br>\r?\n<br>){1,}");
59 re_mail = new RE("([a-zA-Z0-9_.-]+)@([a-zA-Z0-9_-]+)\\.([a-zA-Z0-9_.-]+)");
60 re_url = new RE("((https://)|(http://)|(ftp://)){1}([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>\\)\\]]+[^ \t\r\n.,<>\\)\\]])");
61 re_tags = new RE("<[^>]*>",RE.REG_ICASE);
63 catch (REException e){
64 System.err.println("FATAL: StringUtil: could not precompile REGEX: "+e.toString());
69 * Formats a number with the specified minimum and maximum number of digits.
71 public static synchronized String zeroPaddingNumber(long value, int minDigits,
74 NumberFormat numberFormat = NumberFormat.getInstance();
75 numberFormat.setMinimumIntegerDigits(minDigits);
76 numberFormat.setMaximumIntegerDigits(maxDigits);
77 return numberFormat.format(value);
81 * Wandelt Datum in einen 8-ziffrigen String um (yyyymmdd)
83 * @return 8-ziffriger String (yyyymmdd)
86 public static final String date2webdbDate (GregorianCalendar theDate) {
87 StringBuffer webdbDate = new StringBuffer();
88 webdbDate.append(String.valueOf(theDate.get(Calendar.YEAR)));
89 webdbDate.append(pad2(theDate.get(Calendar.MONTH) + 1));
90 webdbDate.append(pad2(theDate.get(Calendar.DATE)));
91 return webdbDate.toString();
95 * Wandelt Calendar in einen 12-ziffrigen String um (yyyymmddhhmm)
97 * @return 12-ziffriger String (yyyymmdd)
100 public static final String date2webdbDateTime (GregorianCalendar theDate) {
101 StringBuffer webdbDate = new StringBuffer();
102 webdbDate.append(String.valueOf(theDate.get(Calendar.YEAR)));
103 webdbDate.append(pad2(theDate.get(Calendar.MONTH) + 1));
104 webdbDate.append(pad2(theDate.get(Calendar.DATE)));
105 webdbDate.append(pad2(theDate.get(Calendar.HOUR)));
106 webdbDate.append(pad2(theDate.get(Calendar.MINUTE)));
107 return webdbDate.toString();
111 * Return a http://www.w3.org/TR/NOTE-datetime formatted date (yyyy-mm-ddThh:mm:ssTZ)
113 * @return w3approved datetime
116 public static final String date2w3DateTime (GregorianCalendar theDate) {
117 StringBuffer webdbDate = new StringBuffer();
118 webdbDate.append(String.valueOf(theDate.get(Calendar.YEAR)));
119 webdbDate.append("-");
120 webdbDate.append(pad2(theDate.get(Calendar.MONTH) + 1));
121 webdbDate.append("-");
122 webdbDate.append(pad2(theDate.get(Calendar.DATE)));
123 webdbDate.append("T");
124 webdbDate.append(pad2(theDate.get(Calendar.HOUR)));
125 webdbDate.append(":");
126 webdbDate.append(pad2(theDate.get(Calendar.MINUTE)));
127 webdbDate.append(":");
128 webdbDate.append(pad2(theDate.get(Calendar.SECOND)));
129 //assumes you are an hour-multiple away from UTC....
130 int offset=(theDate.get(Calendar.ZONE_OFFSET)/(60*60*1000));
132 webdbDate.append("-");
135 webdbDate.append("+");
137 webdbDate.append(pad2(Math.abs(offset)));
138 webdbDate.append(":00");
139 return webdbDate.toString();
143 * wandelt Calendar in dd.mm.yyyy / hh.mm um
145 * @return String mit (dd.mm.yyyy / hh.mm um)
147 public static String date2readableDateTime (GregorianCalendar theDate) {
148 String readable = "";
150 readable += pad2(theDate.get(Calendar.DATE));
151 readable += "." + pad2(theDate.get(Calendar.MONTH) + 1);
152 readable += "." + String.valueOf(theDate.get(Calendar.YEAR));
153 hour = theDate.get(Calendar.HOUR);
154 if (theDate.get(Calendar.AM_PM) == Calendar.PM)
156 readable += " / " + pad2(hour);
157 readable += ":" + pad2(theDate.get(Calendar.MINUTE));
162 * wandelt eine Datum in einen 8-buchstabigen String, der durch <code>/</code>
166 * @return String mit <code>/yyyy/mm/dd</code>
168 public static final String webdbDate2path (String webdbDate) {
169 StringBuffer path = new StringBuffer();
170 path.append("/").append(webdbDate.substring(0, 4));
171 path.append("/").append(webdbDate.substring(4, 6));
174 //path.append("/").append(webdbDate.substring(6, 8));
175 return path.toString();
179 * wandelt Calendar in dd.mm.yyyy um
182 * @return String mit <code>yyyy.mm.dd</code>
184 public static final String webdbDate2readableDate (String webdbDate) {
186 date += webdbDate.substring(0, 4);
187 date += "-" + webdbDate.substring(5, 7);
188 date += "-"+webdbDate.substring(8, 10);
194 * converts string from format: yyyy-mm-dd__hh:mm:ss.d
195 * to dd.mm.yyyy hh:mm
197 public static String dateToReadableDate(String date) {
198 StringBuffer returnDate = new StringBuffer();
201 returnDate.append(date.substring(8,10)).append('.');
202 returnDate.append(date.substring(5,7)).append('.');
203 returnDate.append(date.substring(0,4)).append(' ');
204 returnDate.append(date.substring(11,16));
206 return returnDate.toString();
210 * converts string from format: yyyy-mm-dd__hh:mm:ss.dddddd+TZ
211 * to yyyy-mm-ddThh:mm:ss+TZ:00 (w3 format for Dublin Core)
213 public static String webdbdateToDCDate(String date) {
214 StringBuffer returnDate = new StringBuffer();
216 returnDate.append(date.substring(0,10));
217 returnDate.append("T");
218 returnDate.append(date.substring(11,19));
219 //String tzInfo=date.substring(26,29);
220 //if (tzInfo.equals("+00")){
221 //UTC gets a special code in w3 dates
222 // returnDate.append("Z");
225 //need to see what a newfoundland postgres
226 //timestamp looks like before making this robust
227 // returnDate.append(tzInfo);
228 // returnDate.append(":00");
232 return returnDate.toString();
237 * converts string from format: yyyy-mm-dd__hh:mm:ss.d
240 public static String dateToYear (String date) {
241 StringBuffer returnDate = new StringBuffer();
244 returnDate.append(date.substring(0,4));
246 return returnDate.toString();
250 * converts string from format: yyyy-mm-dd__hh:mm:ss.d
253 public static String dateToMonth (String date) {
254 StringBuffer returnDate = new StringBuffer();
256 if (!date.substring(5,6).equalsIgnoreCase("0")) returnDate.append(date.substring(5,7));
257 else returnDate.append(date.substring(6,7));
259 return returnDate.toString();
263 * converts string from format: yyyy-mm-dd__hh:mm:ss.d
266 public static String dateToDayOfMonth (String date) {
267 StringBuffer returnDate = new StringBuffer();
269 if (!date.substring(8,9).equalsIgnoreCase("0")) returnDate.append(date.substring(8,10));
270 else returnDate.append(date.substring(9,10));
272 return returnDate.toString();
276 * converts string from format: yyyy-mm-dd__hh:mm:ss.d
279 public static String dateToTime (String date) {
280 StringBuffer returnDate = new StringBuffer();
282 returnDate.append(date.substring(11,16));
284 return returnDate.toString();
288 * Splits the provided CSV text into a list. stolen wholesale from
289 * from Jakarta Turbine StrinUtils.java -mh
291 * @param text The CSV list of values to split apart.
292 * @param separator The separator character.
293 * @return The list of values.
295 public static String[] split(String text, String separator)
297 StringTokenizer st = new StringTokenizer(text, separator);
298 String[] values = new String[st.countTokens()];
300 while (st.hasMoreTokens())
302 values[pos++] = st.nextToken();
308 * Joins the elements of the provided array into a single string
309 * containing a list of CSV elements. Stolen wholesale from Jakarta
310 * Turbine StringUtils.java. -mh
312 * @param list The list of values to join together.
313 * @param separator The separator character.
314 * @return The CSV text.
316 public static String join(String[] list, String separator)
318 StringBuffer csv = new StringBuffer();
319 for (int i = 0; i < list.length; i++)
323 csv.append(separator);
327 return csv.toString();
332 * schließt einen String in Anführungsszeichen ein, falls er Leerzeichen o.ä. enthält
334 * @return gequoteter String
336 public static String quoteIfNecessary(String s) {
337 for (int i = 0; i < s.length(); i++)
338 if (!(Character.isLetterOrDigit(s.charAt(i)) || s.charAt(i) == '.'))
339 return quote(s, '"');
344 * schließt <code>s</code> in <code>'</code> ein und setzt Backslashes vor
345 * "gefährliche" Zeichen innerhalb des Strings
346 * Quotes special SQL-characters in <code>s</code>
348 * @return geqoteter String
350 public static String quote(String s)
352 //String s2 = quote(s, '\'');
353 //Quickhack ÊÊ Ê Ê Ê Ê Ê Ê
354 //Because of '?-Bug in Postgresql-JDBC-Driver
355 StringBuffer temp = new StringBuffer();
356 for(int i=0;i<s.length();i++){
357 if(s.charAt(i)=='\''){
358 temp.append("'");
360 temp.append(s.charAt(i));
363 String s2 = temp.toString();
366 s2 = quote(s2, '\"');
371 * schließt <code>s</code> in <code>'</code> ein und setzt Backslashes vor
372 * "gefährliche" Zeichen innerhalb des Strings
374 * @param s String, der gequoted werden soll
375 * @param quoteChar zu quotendes Zeichen
376 * @return gequoteter String
378 public static String quote(String s, char quoteChar)
380 StringBuffer buf = new StringBuffer(s.length());
382 while (pos < s.length()) {
383 int i = s.indexOf(quoteChar, pos);
384 if (i < 0) i = s.length();
385 buf.append(s.substring(pos, i));
387 if (pos < s.length()) {
389 buf.append(quoteChar);
393 return buf.toString();
397 * replaces dangerous characters in <code>s</code>
401 public static String unquote(String s)
404 StringBuffer buf = new StringBuffer(s.length());
406 String searchString = "\\"+quoteChar;
407 while (pos < s.length()) {
408 int i = s.indexOf(searchString, pos);
409 if (i < 0) i = s.length();
410 buf.append(s.substring(pos, i));
413 return buf.toString();
417 * Wandelet String in byte[] um.
419 * @return byte[] des String
422 public static byte[] stringToBytes(String s) {
423 String crlf = System.getProperty("line.separator");
424 if (!crlf.equals("\n"))
425 s = replace(s, "\n", crlf);
426 // byte[] buf = new byte[s.length()];
427 byte[] buf = s.getBytes();
432 * Ersetzt in String <code>s</code> das <code>pattern</code> durch <code>substitute</code>
436 * @return String mit den Ersetzungen
438 public static String replace(String s, String pattern, String substitute) {
439 int i = 0, pLen = pattern.length(), sLen = substitute.length();
440 StringBuffer buf = new StringBuffer(s.length());
442 int j = s.indexOf(pattern, i);
444 buf.append(s.substring(i));
447 buf.append(s.substring(i, j));
448 buf.append(substitute);
452 return buf.toString();
456 * Ersetzt in String <code>s</code> das Regexp <code>pattern</code> durch <code>substitute</code>
460 * @return String mit den Ersetzungen
462 public static String regexpReplace(String haystack, String pattern, String substitute) {
464 RE regex = new RE(pattern);
465 return regex.substituteAll(haystack,substitute);
466 } catch(REException ex){
475 * Fügt einen Separator an den Pfad an
477 * @return Pfad mit Separator am Ende
479 public static final String addSeparator (String path) {
480 return path.length() == 0 || path.endsWith(File.separator) ? path : path
481 + File.separatorChar;
485 * Fügt ein <code>/</code> ans ende des Strings and
487 * @return Pfad mit <code>/</code> am Ende
489 public static final String addSlash (String path) {
490 return path.length() == 0 || path.endsWith("/") ? path : path + '/';
494 * Löscht <code>/</code> am Ende des Strings, falls vorhanden
496 * @return String ohne <code>/</code> am Ende
498 public static final String removeSlash (String path) {
499 return path.length() > 1 && path.endsWith("/") ? path.substring(0, path.length()
504 * Checks to see if the path is absolute by looking for a leading file
509 public static boolean isAbsolutePath (String path) {
510 return path.startsWith(File.separator);
514 * Löscht Slash am Anfang des Strings
518 public static String removeFirstSlash (String path) {
519 return path.startsWith("/") ? path.substring(1) : path;
523 * formatiert eine Zahl (0-99) zweistellig (z.B. 5 -> 05)
524 * @return zwistellige Zahl
526 public static String pad2 (int number) {
527 return number < 10 ? "0" + number : String.valueOf(number);
531 * formatiert eine Zahl (0-999) dreistellig (z.B. 7 -> 007)
533 * @return 3-stellige Zahl
535 public static String pad3 (int number) {
536 return number < 10 ? "00" + number : number < 100 ? "0" + number : String.valueOf(number);
540 * Konvertiert Unix-Linefeeds in Win-Linefeeds
542 * @return Konvertierter String
544 public static String unixLineFeedsToWin(String s) {
547 i = s.indexOf('\n', i+1);
549 if ((i == 0 || s.charAt(i-1) != '\r') &&
550 (i == s.length()-1 || s.charAt(i+1) != '\r')) {
551 s = s.substring(0, i)+'\r'+s.substring(i);
560 * verwandelt einen String in eine gültige Url, konvertiert Sonderzeichen
561 * und Spaces werden zu Underscores
563 * @return gültige Url
565 public static String convert2url(String s) {
567 StringBuffer buf = new StringBuffer();
568 for(int i = 0; i < s.length(); i++ ) {
569 switch( s.charAt( i ) ) {
571 buf.append( "oe" ); break;
573 buf.append( "ae" ); break;
575 buf.append( "ue" ); break;
577 buf.append( "a" ); break;
580 buf.append( "_" ); break;
582 if( buf.charAt( buf.length() - 1 ) != '_' ) {
587 buf.append( s.charAt( i ) );
590 return buf.toString();
593 public static String replaceQuot(String s) {
594 StringBuffer buffer = new StringBuffer();
595 for(int j = 0; j < s.length();j++){
596 if(s.charAt(j)=='&'){
597 if(s.indexOf( """,j) == j) {
598 buffer.append( "\"" );
602 buffer.append(s.charAt(j));
605 return buffer.toString();
609 * schnellere Variante der String.toLowerCase()-Routine
611 * @return String in Kleinbuchsten
613 public static String toLowerCase(String s) {
615 char[] a = new char[l];
616 for (int i = 0; i < l; i++)
617 a[i] = Character.toLowerCase(s.charAt(i));
618 return new String(a);
622 * Findet <code>element</code> im String-Array <code>array</code>
625 * @return Fundstelle als int oder -1
627 public static int indexOf(String[] array, String element) {
629 for (int i = 0; i < array.length; i++)
630 if (array[i].equals(element))
636 * Testet auf Vorkommen von <code>element</code> in <code>array</code>
637 * @param array String-Array
639 * @return true wenn <code>element</code> vorkommt, sonst false
641 public static boolean contains(String[] array, String element) {
642 return indexOf(array, element) >= 0;
646 * Ermittelt CRC-Prüfsumme von String <code>s</code>
648 * @return CRC-Prüfsumme
650 public static int getCRC(String s) {
652 char val[] = s.toCharArray();
653 int len = val.length;
655 for (int i = 0 ; i < len; i++) {
657 h = (((h >> 30) | (h << 1)) ^ (val[i]+i));
660 return (h << 8) | (len & 0xff);
664 * Liefert Default-Wert def zurück, wenn String <code>s</code>
669 * @return geparster int aus s oder def
671 public static int parseInt(String s, int def) {
672 if (s == null) return def;
674 return Integer.parseInt(s);
675 } catch (NumberFormatException e) {
681 * Liefert Defaultwert def zurück, wenn s nicht zu einem float geparsed werden kann.
684 * @return geparster float oder def
686 public static float parseFloat(String s, float def) {
687 if (s == null) return def;
689 return new Float(s).floatValue();
690 } catch (NumberFormatException e) {
696 * Findet Ende eines Satzes in String <code>text</code>
699 * @return index des Satzendes, oder -1
701 public static int findEndOfSentence(String text, int startIndex) {
703 int i = text.indexOf('.', startIndex);
704 if (i < 0) return -1;
705 if (i > 0 && !Character.isDigit(text.charAt(i-1)) &&
706 (i+1 >= text.length()
707 || text.charAt(i+1) == ' '
708 || text.charAt(i+1) == '\n'
709 || text.charAt(i+1) == '\t'))
716 * Findet Wortende in String <code>text</code> ab <code>startIndex</code>
719 * @return Index des Wortendes, oder -1
721 public static int findEndOfWord(String text, int startIndex) {
722 int i = text.indexOf(' ', startIndex),
723 j = text.indexOf('\n', startIndex);
724 if (i < 0) i = text.length();
725 if (j < 0) j = text.length();
726 return Math.min(i, j);
731 * convertNewline2P ist eine regex-routine zum umwandeln von 2 oder mehr newlines (\n)
732 * in den html-tag <p>
733 * nur sinnvoll, wenn text nicht im html-format eingegeben
735 public static String convertNewline2P(String haystack) {
736 return re_brbr2p.substituteAll(haystack,"\n</p><p>");
740 * convertNewline2Break ist eine regex-routine zum umwandeln von 1 newline (\n)
741 * in den html-tag <br>
742 * nur sinnvoll, wenn text nicht im html-format eingegeben
744 public static String convertNewline2Break(String haystack) {
745 return re_newline2br.substituteAll(haystack,"$0<br />");
749 * createMailLinks wandelt text im email-adressenformat
750 * in einen klickbaren link um
751 * nur sinnvoll, wenn text nicht im html-format eingegeben
753 public static String createMailLinks(String haystack) {
754 return re_mail.substituteAll(haystack,"<a href=\"mailto:$0\">$0</a>");
759 * createMailLinks wandelt text im email-adressenformat
760 * in einen klickbaren link um
761 * nur sinnvoll, wenn text nicht im html-format eingegeben
763 public static String createMailLinks(String haystack, String imageRoot, String mailImage) {
764 return re_mail.substituteAll(haystack,"<img src=\""+imageRoot+"/"+mailImage+"\" border=\"0\"/> <a href=\"mailto:$0\">$0</a>");
769 * createURLLinks wandelt text im url-format
770 * in einen klickbaren link um
771 * nur sinnvoll, wenn text nicht im html-format eingegeben
773 public static String createURLLinks(String haystack) {
774 return re_url.substituteAll(haystack,"<a href=\"$0\">$0</a>");
778 * this routine takes text in url format and makes
779 * a clickaeble "<href>" link removing any "illegal" html tags
780 * @param haystack, the url
781 * @param title, the href link text
782 * @param imagRoot, the place to find icons
783 * @param extImage, the url of the icon to show next to the link
784 * @return a String containing the url
786 public static String createURLLinks(String haystack, String title, String imageRoot,String extImage) {
788 return re_url.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/> <a href=\"$0\">$0</a>");
790 title = removeHTMLTags(title);
791 return re_url.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/> <a href=\"$0\">"+title+"</a>");
796 * this routine takes text in url format and makes
797 * a clickaeble "<href>" link removing any "illegal" html tags
798 * @param haystack, the url
799 * @param imageRoot, the place to find icons
800 * @param extImage, the url of the icon to show next to the link
801 * @param intImage, unused
802 * @return a String containing the url
804 public static String createURLLinks(String haystack, String title, String imageRoot,String extImage,String intImage) {
805 return createURLLinks(haystack, title, imageRoot, extImage);
809 * deleteForbiddenTags
810 * this method deletes all <script>, <body> and <head>-tags
812 public static final String deleteForbiddenTags(String haystack) {
814 RE regex = new RE("<[ \t\r\n](.*?)script(.*?)/script(.*?)>",RE.REG_ICASE);
815 haystack = regex.substituteAll(haystack,"");
816 regex = new RE("<head>(.*?)</head>");
817 haystack = regex.substituteAll(haystack,"");
818 regex = new RE("<[ \t\r\n/]*body(.*?)>");
819 haystack = regex.substituteAll(haystack,"");
821 } catch(REException ex){
827 * this method deletes all html tags
829 public static final String removeHTMLTags(String haystack){
830 return re_tags.substituteAll(haystack,"");
835 * this method deletes all but the approved tags html tags
836 * it also deletes approved tags which contain malicious-looking attributes and doesn't work at all
838 public static String approveHTMLTags(String haystack){
840 String approvedTags="a|img|h1|h2|h3|h4|h5|h6|br|b|i|strong|p";
841 String badAttributes="onAbort|onBlur|onChange|onClick|onDblClick|onDragDrop|onError|onFocus|onKeyDown|onKeyPress|onKeyUp|onLoad|onMouseDown|onMouseMove|onMouseOut|onMouseOver|onMouseUp|onMove|onReset|onResize|onSelect|onSubmit|onUnload";
842 String approvedProtocols="rtsp|http|ftp|https|freenet|mailto";
844 // kill all the bad tags that have attributes
845 String s = "<\\s*/?\\s*(?!(("+approvedTags+")\\s))\\w+\\s[^>]*>";
846 RE regex = new RE(s,RE.REG_ICASE);
847 haystack = regex.substituteAll(haystack,"");
849 // kill all the bad tags that are attributeless
850 regex = new RE("<\\s*/?\\s*(?!(("+approvedTags+")\\s*>))\\w+\\s*>",RE.REG_ICASE);
851 haystack = regex.substituteAll(haystack,"");
853 // kill all the tags which have a javascript attribute like onLoad
854 regex = new RE("<[^>]*("+badAttributes+")[^>]*>",RE.REG_ICASE);
855 haystack = regex.substituteAll(haystack,"");
857 // kill all the tags which include a url to an unacceptable protocol
858 regex = new RE("<\\s*a\\s+[^>]*href=(?!(\'|\")?("+approvedProtocols+"))[^>]*>",RE.REG_ICASE);
859 haystack = regex.substituteAll(haystack,"");
862 } catch(REException ex){
863 ex.printStackTrace();
870 * createHTML ruft alle regex-methoden zum unwandeln eines nicht
871 * htmlcodierten string auf und returnt einen htmlcodierten String
873 public static String createHTML(String content){
874 content=convertNewline2Break(content);
875 content=convertNewline2P(content);
876 content=createMailLinks(content);
877 content=createURLLinks(content);
883 * createHTML ruft alle regex-methoden zum unwandeln eines nicht
884 * htmlcodierten string auf und returnt einen htmlcodierten String
886 public static String createHTML(String content,String producerDocRoot,String mailImage,String extImage,String intImage){
887 content=convertNewline2Break(content);
888 content=convertNewline2P(content);
889 content=createMailLinks(content,producerDocRoot,mailImage);
890 content=createURLLinks(content,null,producerDocRoot,extImage,intImage);