public class TextTransfromUtils extends Object
Constructor and Description |
---|
TextTransfromUtils() |
Modifier and Type | Method and Description |
---|---|
protected static String |
convertFileNameAnchorHTML(String url) |
protected static String |
convertMentionPeopleAnchorHTML(String escapedFeedText,
ArrayList<org.gcube.portlets.widgets.pickuser.shared.PickingUser> taggedPeople)
convert the mentioned people in HTML anchor and also Encode the params Base64
|
protected static String |
escapeHtmlAndTransformUrl(String html)
Escape an html string.
|
protected static String |
extractURL(String feedText)
utility method that extract an url ina text when you paste a link
|
protected static ArrayList<String> |
getImagesWithCleaner(URL pageURL)
try with HtmlCleaner API to read the images
|
protected static String |
getImageUrlFromSrcAttribute(URL pageURL,
String srcAttr)
There are several ways to refer an image in a HTML, this method use an heuristic to get the actual image url
|
protected static LinkPreview |
getInfoFromHTML(URLConnection connection,
URL pageUrl,
String link,
String host)
to use when OpenGraph is not available, Tries Metadata first, then Best guess from page content
|
protected static String |
replaceAmpersand(String toReplace) |
protected 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
|
protected static void |
trustAllHTTPSConnections()
this method handles the non trusted https connections
|
protected static String convertFileNameAnchorHTML(String url)
preview
- protected static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList<org.gcube.portlets.widgets.pickuser.shared.PickingUser> taggedPeople)
escapedFeedText
- taggedPeople
- protected static String escapeHtmlAndTransformUrl(String html)
html
- the html string to escapeprotected static String extractURL(String feedText)
feedText
- protected static ArrayList<String> getImagesWithCleaner(URL pageURL) throws IOException
pageURL
- IOException
protected static String getImageUrlFromSrcAttribute(URL pageURL, String srcAttr)
pageURL
- the urlsrcAttr
- the content of the img src attributeprotected static LinkPreview getInfoFromHTML(URLConnection connection, URL pageUrl, String link, String host) throws Exception
pageUrl
- link
- host
- IOException
Exception
protected static String transformUrls(String feedText)
feedText
- protected static void trustAllHTTPSConnections()
Copyright © 2014. All Rights Reserved.