| java.lang.Object org.apache.roller.ui.rendering.velocity.deprecated.OldUtilities
OldUtilities | public class OldUtilities (Code) | | Utility methods needed by old Roller 2.X macros/templates.
Deprecated because they are either redundant or unnecesary.
|
Method Summary | |
public static String | addNofollow(String html) Code (stolen from Pebble) to add rel="nofollow" string to all links in HTML. | public static String | autoformat(String s) Autoformat. | final public static String | charToCDATA(char ch) Converts a character to CDATA character.
Parameters: ch - The character to convert. | final public static String | charToHTML(char ch, boolean xml) Converts a character to HTML or XML entity.
Parameters: ch - The character to convert. Parameters: xml - Convert the character to XML if set to true. author: Erik C. | final public static String | decode(String s) URL decoding. | public static String | decodeString(String str) Decode a string using Base64 encoding. | final public static String | encode(String s) URL encoding. | public static String | encodeEmail(String str) | public static String | encodeString(String str) Encode a string using Base64 encoding. | public static boolean | equals(String str1, String str2) | public static String | escapeHTML(String str) | public static String | escapeHTML(String s, boolean escapeAmpersand) Escape, but do not replace HTML. | public static String | format8charsDate(Date date) Return a date in RFC-822 format. | public static String | formatDate(Date d, String fmt) Format date using SimpleDateFormat format string. | public static String | formatIso8601Date(Date d) Format date in ISO-8601 format. | public static String | formatIso8601Day(Date d) Format date in ISO-8601 format. | public static String | formatRfc822Date(Date date) Return a date in RFC-822 format. | public static Date | getNow() Return date for current time. | public static String | hexEncode(String str) | public static boolean | isAlphanumeric(String str) | public static boolean | isEmpty(String str) | public static boolean | isNotEmpty(String str) | public static String | left(String str, int length) | public static String | removeHTML(String str) Remove occurences of html, defined as any text
between the characters "<" and ">". | public static String | removeHTML(String str, boolean addSpace) Remove occurences of html, defined as any text
between the characters "<" and ">". | public static String | replace(String src, String target, String rWith) | public static String | replace(String src, String target, String rWith, int maxCount) | public static String[] | split(String str1, String str2) | public static String | stringReplace(String str, String str1, String str2) | public static String | stringReplace(String str, String str1, String str2, int maxCount) | public static String[] | stripAll(String[] strs) | final public static String | textToCDATA(String text) Converts a text string to HTML or XML entities.
Parameters: text - The string to convert. | final public static String | textToHTML(String text, boolean xml) Converts a text string to HTML or XML entities.
author: Erik C. | final public static String | textToHTML(String text) Converts a text string to HTML or XML entities.
Parameters: text - The string to convert. author: Erik C. | final public static String | textToXML(String text) Converts a text string to XML entities.
Parameters: text - The string to convert. author: Erik C. | public static String | toBase64(byte[] aValue) | public static String | transformToHTMLSubset(String s) Transforms the given String into a subset of HTML displayable on a web
page. | public static String | truncate(String str, int lower, int upper, String appendToEnd) Strips HTML and truncates. | public static String | truncateNicely(String str, int lower, int upper, String appendToEnd) | public static String | truncateText(String str, int lower, int upper, String appendToEnd) | public static String | unescapeHTML(String str) |
addNofollow | public static String addNofollow(String html)(Code) | | Code (stolen from Pebble) to add rel="nofollow" string to all links in HTML.
|
charToCDATA | final public static String charToCDATA(char ch)(Code) | | Converts a character to CDATA character.
Parameters: ch - The character to convert. The converted string. |
charToHTML | final public static String charToHTML(char ch, boolean xml)(Code) | | Converts a character to HTML or XML entity.
Parameters: ch - The character to convert. Parameters: xml - Convert the character to XML if set to true. author: Erik C. Thauvin The converted string. |
decode | final public static String decode(String s)(Code) | | URL decoding.
Parameters: s - a URL-encoded string to be URL-decoded URL decoded value of s using character encoding UTF-8; null if s is null. |
encode | final public static String encode(String s)(Code) | | URL encoding.
Parameters: s - a string to be URL-encoded URL encoding of s using character encoding UTF-8; null if s is null. |
encodeString | public static String encodeString(String str) throws IOException(Code) | | Encode a string using Base64 encoding. Used when storing passwords
as cookies.
This is weak encoding in that anyone can use the decodeString
routine to reverse the encoding.
Parameters: str - String throws: IOException - |
escapeHTML | public static String escapeHTML(String s, boolean escapeAmpersand)(Code) | | Escape, but do not replace HTML.
Parameters: escapeAmpersand - Optionally escapeampersands (&). |
format8charsDate | public static String format8charsDate(Date date)(Code) | | Return a date in RFC-822 format.
|
formatDate | public static String formatDate(Date d, String fmt)(Code) | | Format date using SimpleDateFormat format string.
|
formatIso8601Date | public static String formatIso8601Date(Date d)(Code) | | Format date in ISO-8601 format.
|
formatIso8601Day | public static String formatIso8601Day(Date d)(Code) | | Format date in ISO-8601 format.
|
formatRfc822Date | public static String formatRfc822Date(Date date)(Code) | | Return a date in RFC-822 format.
|
getNow | public static Date getNow()(Code) | | Return date for current time.
|
isAlphanumeric | public static boolean isAlphanumeric(String str)(Code) | | |
isNotEmpty | public static boolean isNotEmpty(String str)(Code) | | |
removeHTML | public static String removeHTML(String str)(Code) | | Remove occurences of html, defined as any text
between the characters "<" and ">". Replace
any HTML tags with a space.
|
removeHTML | public static String removeHTML(String str, boolean addSpace)(Code) | | Remove occurences of html, defined as any text
between the characters "<" and ">".
Optionally replace HTML tags with a space.
|
stringReplace | public static String stringReplace(String str, String str1, String str2, int maxCount)(Code) | | Replace occurrences of str1 in string str with str2
Parameters: str - String to operate on Parameters: str1 - String to be replaced Parameters: str2 - String to be used as replacement Parameters: maxCount - Number of times to replace, 0 for all |
textToCDATA | final public static String textToCDATA(String text)(Code) | | Converts a text string to HTML or XML entities.
Parameters: text - The string to convert. The converted string. |
textToHTML | final public static String textToHTML(String text, boolean xml)(Code) | | Converts a text string to HTML or XML entities.
author: Erik C. Thauvin Parameters: text - The string to convert. Parameters: xml - Convert the string to XML if set to true. The converted string. |
textToHTML | final public static String textToHTML(String text)(Code) | | Converts a text string to HTML or XML entities.
Parameters: text - The string to convert. author: Erik C. Thauvin The converted string. |
textToXML | final public static String textToXML(String text)(Code) | | Converts a text string to XML entities.
Parameters: text - The string to convert. author: Erik C. Thauvin The converted string. |
toBase64 | public static String toBase64(byte[] aValue)(Code) | | Convert a byte array into a Base64 string (as used in mime formats)
|
transformToHTMLSubset | public static String transformToHTMLSubset(String s)(Code) | | Transforms the given String into a subset of HTML displayable on a web
page. The subset includes <b>, <i>, <p>, <br>,
<pre> and <a href> (and their corresponding end tags).
Parameters: s - the String to transform the transformed String |
truncate | public static String truncate(String str, int lower, int upper, String appendToEnd)(Code) | | Strips HTML and truncates.
|
|
|