public final class StringUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
base64ToHex(String value)
Convert base64 value to hex.
|
static String |
base64ToUrl(String value)
Encode EWS base64 itemId to url compatible value.
|
static String |
convertZuluDateTimeToAllDay(String value)
Get allday date value from zulu timestamp.
|
static String |
davSearchEncode(String value)
Encode quotes in Dav search parameter.
|
static String |
decodeFolderName(String folderName)
Decode the folder name with _xF8FF_ or _x003E_ characters.
|
static String |
decodeUrlcompname(String urlcompname)
Decode urlcompname to get item name.
|
static String |
encodeFolderName(String folderName)
folderName may contain / or > characters, encode them.
|
static String |
encodePlusSign(String value)
Urlencode plus sign in encoded href.
|
static String |
encodeUrlcompname(String value)
Encode item name to get actual value stored in urlcompname MAPI property.
|
static String |
escapeQuotes(String value)
Escape quotes for DAV and graph filters.
|
static String |
getLastToken(String value,
String startDelimiter,
String endDelimiter)
Return the sub string between startDelimiter and endDelimiter or null,
look for last token in string.
|
static String |
getToken(String value,
String startDelimiter,
String endDelimiter)
Return the sub string between startDelimiter and endDelimiter or null.
|
static String |
hexToBase64(String value)
Convert hex value to base64.
|
static String |
join(Set<String> values,
String separator)
Join values with given separator.
|
static String |
parseQuotedImapString(String quoted)
Takes a quoted string according to IMAP rfc 3501 and returns its intrinsic (unquoted) string value.
|
static String |
removeQuotes(String value)
Remove quotes if present on value.
|
static String |
replaceToken(String value,
String startDelimiter,
String endDelimiter,
String newToken)
Return the sub string between startDelimiter and endDelimiter with newToken.
|
static String |
urlToBase64(String value)
Encode EWS url compatible itemId back to base64 value.
|
static String |
xmlDecode(String name)
Need to decode xml for iCal
|
static String |
xmlEncode(String name)
Xml encode content.
|
static String |
xmlEncodeAttribute(String name)
Xml encode inside attribute.
|
public static String getToken(String value, String startDelimiter, String endDelimiter)
value - String valuestartDelimiter - start delimiterendDelimiter - end delimiterpublic static String getLastToken(String value, String startDelimiter, String endDelimiter)
value - String valuestartDelimiter - start delimiterendDelimiter - end delimiterpublic static String replaceToken(String value, String startDelimiter, String endDelimiter, String newToken)
value - String valuestartDelimiter - start delimiterendDelimiter - end delimiternewToken - new token valuepublic static String join(Set<String> values, String separator)
values - value setseparator - separatorpublic static String xmlEncode(String name)
name - decoded namepublic static String xmlEncodeAttribute(String name)
name - decoded namepublic static String xmlDecode(String name)
name - encoded namepublic static String base64ToHex(String value)
value - base64 valuepublic static String hexToBase64(String value) throws org.apache.commons.codec.DecoderException
value - hex valueorg.apache.commons.codec.DecoderException - on errorpublic static String encodeUrlcompname(String value)
value - decoded valuepublic static String decodeUrlcompname(String urlcompname)
urlcompname - encoded valuepublic static String encodePlusSign(String value)
value - encoded hrefpublic static String base64ToUrl(String value)
value - base64 valuepublic static String urlToBase64(String value)
value - url compatible valuepublic static String davSearchEncode(String value)
value - search parameterpublic static String escapeQuotes(String value)
value - input valuepublic static String convertZuluDateTimeToAllDay(String value)
value - zulu datetimepublic static String parseQuotedImapString(String quoted) throws ParseException
RFC 3501 defines a quoted string in its ABNF as follows:
quoted = DQUOTE *QUOTED-CHAR DQUOTE
DQUOTE = %x22
; " (Double Quote)
QUOTED-CHAR = <any TEXT-CHAR except quoted-specials> /
"\" quoted-specials / UTF8-2 / UTF8-3 / UTF8-4
TEXT-CHAR = <any CHAR except CR and LF>
quoted-specials = DQUOTE / "\"
quoted - the quoted string or nullIllegalArgumentException - when the given quoted string is not validParseExceptionpublic static String removeQuotes(String value)
value - input valuepublic static String decodeFolderName(String folderName)
folderName - encoded folder nameCopyright © 2001–2025 MickaĆ«l Guessant. All rights reserved.