/** * Wrap all urls ('http://', 'www.', and 'ftp://') in specified string with href tags. * @param str The block of text to check. * @return String The block of text with all url's placed in href tags. */ public final static String linkURL(String str) { return linkURL(str, null); }
/** * Wrap all urls ('http://', 'www.', and 'ftp://') in specified string with href tags. * @param str The block of text to check. * @return String The block of text with all url's placed in href tags. */ public final static String linkURL(String str) { return linkURL(str, null); }
/** * Wrap all urls ('abc://' and 'www.abc') in specified string with href tags. * * @param str The block of text to check. * @param target The target to use for the href (optional). * @return String The block of text with all url's placed in href tags. */ public final static String linkURL(String str, String target) { StringBuffer sb = new StringBuffer((int) (str.length() * 1.05)); sb.append(str); linkURL(sb, target); return sb.toString(); }
/** * Convert all URLs and E-mail addresses in a string into hyperlinks. * * @param text The block of text to hyperlink. * @param target The target attribute to use for href (optional). * @return the text with known uri formats hyperlinked * * @see #linkEmail(String) * @see #linkURL(String) */ public final static String hyperlink(String text, String target) { text = noNull(text); StringBuffer sb = new StringBuffer((int) (text.length() * 1.1)); sb.append(text); linkEmail(sb); linkURL(sb, target); return sb.toString(); }
/** * Convert all URLs and E-mail addresses in a string into hyperlinks. * * @param text The block of text to hyperlink. * @param target The target attribute to use for href (optional). * @return the text with known uri formats hyperlinked * * @see #linkEmail(String) * @see #linkURL(String) */ public final static String hyperlink(String text, String target) { text = noNull(text); text = linkEmail(text); text = linkURL(text, target); return text; }