public final class MailFolderUtility
extends java.lang.Object
MailFolderUtility - Provides utility methods for mail folders.| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decode(java.lang.String encoded)
Performs mailbox decoding.
|
static java.lang.String |
encode(java.lang.String fullName)
Performs mailbox encoding.
|
static boolean |
equalsFullname(java.lang.String fullnameArgument,
java.lang.String fullname)
Checks if specified full name argument's real full name equals given full name.
|
static boolean |
isEmpty(java.lang.String string)
Tests if specified string is empty; either
null, zero length, or only consists of white space characters. |
static java.lang.String |
prepareFullname(int accountId,
java.lang.String fullname)
Prepends
MailFolder.DEFAULT_FOLDER_ID plus the default separator (obtained by MailConfig#getDefaultSeparator()) to
given folder full name. |
static FullnameArgument |
prepareMailFolderParam(java.lang.String fullnameArgument)
Parses specified full name argument to an appropriate instance of
FullnameArgument. |
static java.lang.String |
sanitizeFullName(java.lang.String fullName)
Sanitizes given folder full name.
|
public static java.lang.String encode(java.lang.String fullName)
fullName - The full namepublic static java.lang.String decode(java.lang.String encoded)
encoded - The encoded full namepublic static FullnameArgument prepareMailFolderParam(java.lang.String fullnameArgument)
FullnameArgument.
Cuts off starting MailFolder.DEFAULT_FOLDER_ID plus the default separator from specified folder full name argument only if
full name argument is not null and is not equal to MailFolder.DEFAULT_FOLDER_ID.
Example:
"default/INBOX" -> "INBOX"
fullnameArgument - The groupware's mail folder full namepublic static boolean equalsFullname(java.lang.String fullnameArgument,
java.lang.String fullname)
fullnameArgument - The full name argumentfullname - The full name to compare withtrue if specified full name argument's real full name equals given full name; otherwise falsepublic static java.lang.String prepareFullname(int accountId,
java.lang.String fullname)
MailFolder.DEFAULT_FOLDER_ID plus the default separator (obtained by MailConfig#getDefaultSeparator()) to
given folder full name. "INBOX" -> "default2/INBOX"
accountId - The account IDfullname - The folder full namepublic static boolean isEmpty(java.lang.String string)
null, zero length, or only consists of white space characters.str - The string to testtrue if specified string is empty; otherwise false.public static java.lang.String sanitizeFullName(java.lang.String fullName)
Common problem are messed-up folder full names like:
"INBOX/default0/actual/folder/path"
==>
"actual/folder/path"
fullName - The full name