public class BowUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BOW_DATE_SHORT_PATTERN |
| Constructor and Description |
|---|
BowUtils()
public to use easily in jsp
|
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
checkPermanentToken(BowSession session,
String token)
check if token exist, if true, put User associated with it, in BowSession
|
protected static boolean |
checkTemporaryToken(BowSession session,
String token)
Check token with temporary token
|
static BowUser |
checkToken(BowSession session,
String token)
Retrieves the user by the temporary or the permanent token
|
static String |
formatDate(Date date) |
static String |
generateToken()
Generates a random token
|
static Set<String> |
getGroups(Set<String> tags)
Recupere la liste des noms des groupes parmi les tags.
|
static Set<String> |
getWords(String tags)
Donne la liste des mots de la chaine passee en parametre.
|
static boolean |
isPublicGroup(BowGroup g) |
static Date |
normalizeDate(Date date)
Retourne toujours une date valide.
|
static String |
normalizeString(String s)
Supprime les blancs de debut et de fin, et retourne une chaine vide si s
est null
|
static String |
normalizeUrl(String url)
Normalise l'url, si elle est null ou vide retourne une chaine vide.
|
static String |
redirectTo(List<String> listId,
String tagLine,
String fullTextLine)
Redirects the user either on the home page or on the search page
|
static String |
redirectTo(String tagLine,
String fullTextLine)
Redirects the user either on the home page or on the search page
|
static String |
toBase64(byte[] b) |
public static final String BOW_DATE_SHORT_PATTERN
public static String toBase64(byte[] b)
public static Date normalizeDate(Date date)
date - null or valide datepublic static String normalizeString(String s)
s - null or stringpublic static String normalizeUrl(String url)
url - l'url a normaliserpublic static Set<String> getWords(String tags)
tags - public static Set<String> getGroups(Set<String> tags)
tags - public static boolean isPublicGroup(BowGroup g)
public static String generateToken()
public static String redirectTo(String tagLine, String fullTextLine)
tagLine - search linefullTextLine - full text searchpublic static String redirectTo(List<String> listId, String tagLine, String fullTextLine)
listId - list of bookmark idtagLine - search linefullTextLine - full text searchpublic static BowUser checkToken(BowSession session, String token)
session - the sessiontoken - either the temporary or the permanent tokenprotected static boolean checkPermanentToken(BowSession session, String token)
session - bow sessiontoken - which contains the MD5 encoding tokenprotected static boolean checkTemporaryToken(BowSession session, String token)
session - bow sessiontoken - which contains the MD5 encoding tokenCopyright © 2010–2015 CodeLutin. All rights reserved.