public class CommonUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AMP |
static String |
AMP_HEX |
static String |
AMP_NUMBER |
static String |
AMP_SPACE |
static String |
ASTERISK_STR |
static String |
COLON |
static String |
COMMA |
static String |
EMPTY_STR |
static String |
FROM_KEY |
static String |
GREATER_THAN |
static String |
LESS_THAN |
static String |
PERCENT_STR |
static String |
QUOT |
static String |
SEMICOLON |
static String |
SLASH |
static String |
SPACE |
| Constructor and Description |
|---|
CommonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
centerTrunc(String str,
int middlePosition,
int maxLength)
Truncates large Strings showing the string around the specific middle position with the specific length.
|
static String |
convertCodeHTML(String s) |
static org.exoplatform.services.jcr.ext.common.SessionProvider |
createSystemProvider() |
static String |
generateCheckSum(byte[] b)
Generates checksum for files, and get a file ending in .sha1
This task can also be used to perform checksum verifications.
|
static <T> T |
getComponent(Class<T> type) |
static String |
getExcerpt(String str,
String textQuery,
int maxLength)
Get excerpt of given string with start position is the first position of textQuery.
|
static org.exoplatform.container.ExoContainer |
getExoContainer(org.quartz.JobExecutionContext context) |
static Calendar |
getGreenwichMeanTime()
Get current time GMT/Zulu or UTC,(zone time is 0+GMT)
|
static String |
getImageUrl(String imagePath) |
static String |
getRSSLink(String appType,
String portalName,
String objectId) |
static String |
getURI(String url)
Get the URI of full URL
|
static String |
getUserRSSLink(String apptype,
String userId) |
static File |
getXMLFile(ByteArrayOutputStream bos,
String appName,
String objectType,
Date createDate,
String fileName) |
static boolean |
hasSpecialCharacter(String input)
To check the input content has special characters or not.
|
static boolean |
isEmpty(String s)
Check string is null or empty
|
static boolean |
isEmpty(String[] array)
check string array is whether empty or not
|
static String |
makeNotificationSender(String from)
This function will change email address in 'from' field by address of mail service
which is configured as system property :
gatein.email.smtp.from or mail.from. |
static String |
normalizeUnifiedSearchInput(String input)
Normalize Unified search input
|
static String |
processBBCode(String s) |
static String |
processSearchCondition(String searchCondition)
Process the search condition correspond to each context
|
static String |
processUnifiedSearchSearchCondition(String input) |
static String |
removeSpecialCharacterForSearch(String input)
Filter all invalid character (anything except word, number, space and search wildcard) from search conditional.
|
static String |
removeSpecialCharacterForUnifiedSearch(String input) |
public static final String COMMA
public static final String SLASH
public static final String EMPTY_STR
public static final String COLON
public static final String SEMICOLON
public static final String SPACE
public static final String ASTERISK_STR
public static final String PERCENT_STR
public static final String AMP_NUMBER
public static final String LESS_THAN
public static final String GREATER_THAN
public static final String QUOT
public static final String AMP_SPACE
public static final String AMP_HEX
public static final String AMP
public static final String FROM_KEY
public static String generateCheckSum(byte[] b) throws Exception
b - Exceptionpublic static File getXMLFile(ByteArrayOutputStream bos, String appName, String objectType, Date createDate, String fileName) throws Exception
Exceptionpublic static String makeNotificationSender(String from)
gatein.email.smtp.from or mail.from. from field
of message from smtp authentication (for now, GMX, MS exchange deny, Gmail efforts to modify the such value)from - public static String getURI(String url)
url - The URL inputpublic static org.exoplatform.container.ExoContainer getExoContainer(org.quartz.JobExecutionContext context)
public static boolean isEmpty(String s)
s - public static boolean isEmpty(String[] array)
array - public static String removeSpecialCharacterForSearch(String input)
input - the input stringpublic static String removeSpecialCharacterForUnifiedSearch(String input)
public static String processUnifiedSearchSearchCondition(String input)
public static String normalizeUnifiedSearchInput(String input)
input - The key searchpublic static boolean hasSpecialCharacter(String input)
input - public static String processSearchCondition(String searchCondition)
searchCondition - the search conditionpublic static String getExcerpt(String str, String textQuery, int maxLength)
str - the give stringtextQuery - the text that we truncate at the first appearmaxLength - max of string lengthpublic static final String centerTrunc(String str, int middlePosition, int maxLength)
str - the string to truncatemiddlePosition - the middle position we will show string aroundmaxLength - the max length of string to showpublic static Calendar getGreenwichMeanTime()
public static <T> T getComponent(Class<T> type)
public static org.exoplatform.services.jcr.ext.common.SessionProvider createSystemProvider()
Copyright © 2003–2023 eXo Platform SAS. All rights reserved.