public class BowUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BOW_DATE_SHORT_PATTERN |
static Map<String,String> |
resourceContent |
| 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 String |
getResourceContent(String resourceName)
Get content of resource in classpath.
|
static Set<String> |
getUsers(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 |
scriptletAdd(String bowUrl,
String token) |
static String |
scriptletPassword(BowAuthentication auth) |
static String |
scriptPassword(BowAuthentication auth) |
static String |
toBase64(byte[] b) |
static String |
toHtml(String markdown) |
static String |
toScriptlet(String js)
Generate valide URL javascript:...
|
public static final String BOW_DATE_SHORT_PATTERN
public static String getResourceContent(String resourceName) throws IOException
resourceName - IOExceptionpublic static String scriptletPassword(BowAuthentication auth)
public static String scriptPassword(BowAuthentication auth)
public static String toScriptlet(String js) throws URISyntaxException
js - javascript codeURISyntaxExceptionpublic 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> getUsers(Set<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.