public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
IPV4_REGEX
IPv4 regex
|
static String |
IPV6_REGEX
IPV6 regex needs to be put in square brackets, see below
|
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static String |
convertFileNameAnchorHTML(String url) |
static String |
convertHashtagsAnchorHTML(String escapedFeedText,
List<String> hashtags)
convert the hashtag in HTML anchor and also Encode the params Base64
|
static String |
convertMentionPeopleAnchorHTML(String escapedFeedText,
ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> taggedPeople,
javax.servlet.http.HttpServletRequest request)
convert the mentioned people in HTML anchor and also Encode the params Base64
|
static String |
createDescriptionFromContent(String link)
generate the description parsing the content (Best Guess)
|
static String |
escapeHtml(String html)
Escape an html string.
|
static String |
escapeHtmlAndTransformUrl(String html)
Escape an html string.
|
static String |
extractURL(String feedText)
utility method that extract an url ina text when you paste a link.
|
static ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> |
getDisplayableItemBeans(String scope,
String currUser,
boolean withinPortal) |
static List<String> |
getHashTags(String postText)
utility method that extract the hashtags from a text
|
static String |
getHttpToken(String originalItem)
check the tokens of a pasted text and see if there's any http link in it
|
static String |
removeHTMLFromText(String text)
Remove HTML tags from text by using the following '\\<[^>]*>"'
|
static String |
transformUrls(String feedText)
utility method that convert a url ina text in a clickable url by the browser
and if the user has just pasted a link, converts the link in: shared a link
|
public static final String IPV4_REGEX
public static final String IPV6_REGEX
public static String convertFileNameAnchorHTML(String url)
preview
- public static ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> getDisplayableItemBeans(String scope, String currUser, boolean withinPortal)
session
- the Asl SessionwithinPortal
- true when is on Liferay portalpublic static List<String> getHashTags(String postText)
postText
- public static String extractURL(String feedText)
feedText
- public static String escapeHtmlAndTransformUrl(String html)
html
- the html string to escapepublic static String escapeHtml(String html)
html
- the html string to escapepublic static String transformUrls(String feedText)
feedText
- public static String getHttpToken(String originalItem)
item
- a text tokenpublic static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList<org.gcube.portlets.widgets.pickitem.shared.ItemBean> taggedPeople, javax.servlet.http.HttpServletRequest request)
escapedFeedText
- taggedPeople
- public static String convertHashtagsAnchorHTML(String escapedFeedText, List<String> hashtags)
escapedFeedText
- hashtags
- public static String createDescriptionFromContent(String link)
link
- the link to checkCopyright © 2019. All Rights Reserved.