removed the set deprecated methods as they should not be

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/social-networking/social-util-library@178469 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2019-03-04 16:44:38 +00:00
parent 1bd21cd2d8
commit 2d2913aea7
1 changed files with 24 additions and 16 deletions

View File

@ -39,25 +39,25 @@ public class Utils {
/**
* Hashtag regex enhanced for ticket #4937
*/
@Deprecated
private static final String HASHTAG_REGEX = "^#\\w+([-_.]?\\w+)*|\\s#\\w+([-_.]?\\w+)*|(?<=[\\[({])#\\w+([-_.]?\\w+)";
/**
* IPv4 regex
*/
@Deprecated
public static final String IPV4_REGEX = "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b";
/**
* IPV6 regex needs to be put in square brackets, see below
*/
@Deprecated
public static final String IPV6_REGEX = "\\b(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\\b";
/**
* Pattern for URLS
*/
@Deprecated
private static final Pattern URL_PATTERN = Pattern.compile(
"\\b(((ht|f)tp(s?)\\:\\/\\/|~\\/|\\/)|www.)" +
"(\\w+:\\w+@)?((([-\\w]+\\.)+(com|org|net|gov" +
@ -161,7 +161,7 @@ public class Utils {
* @param postText
* @return the list of hashtags present in the text
*/
@Deprecated
public static List<String> getHashTags(String postText) {
List<String> hashtags = new ArrayList<>();
Pattern MY_PATTERN = Pattern.compile(HASHTAG_REGEX);//Pattern.compile("^#\\w+|\\s#\\w+");
@ -178,7 +178,7 @@ public class Utils {
* @param feedText
* @return the text with the clickable url in it
*/
@Deprecated
public static String extractURL(String feedText) {
// separate input by spaces ( URLs have no spaces )
feedText = feedText.replaceAll("(\r\n|\n)"," <br/> ");
@ -207,7 +207,7 @@ public class Utils {
* @param html the html string to escape
* @return the escaped string
*/
@Deprecated
public static String escapeHtmlAndTransformUrl(String html) {
if (html == null) {
return null;
@ -230,7 +230,7 @@ public class Utils {
* @param html the html string to escape
* @return the escaped string
*/
@Deprecated
public static String escapeHtml(String html) {
return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;")
.replaceAll(">", "&gt;");
@ -242,7 +242,7 @@ public class Utils {
* @param feedText
* @return the text with the clickable url in it
*/
@Deprecated
public static String transformUrls(String feedText) {
StringBuilder sb = new StringBuilder();
// separate input by spaces ( URLs have no spaces )
@ -276,7 +276,7 @@ public class Utils {
* @param item a text token
* @return the actual http link
*/
@Deprecated
public static String getHttpToken(String originalItem) {
// apply pattern
String item = null;
@ -304,15 +304,19 @@ public class Utils {
* @param taggedPeople
* @return
*/
@Deprecated
public static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList<ItemBean> taggedPeople, HttpServletRequest request) {
String pageToRedirectURL = "";
String httpGETAttrName = "";
String httpGETAttrValue ="";
PortalContext pContext = PortalContext.getConfiguration();
String gatewayURL = pContext.getGatewayURL(request);
for (ItemBean tagged : taggedPeople) {
if (! tagged.isItemGroup()) {
pageToRedirectURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
StringBuilder sb = new StringBuilder(gatewayURL)
.append(pContext.getSiteLandingPagePath(request))
.append(GCubePortalConstants.USER_PROFILE_FRIENDLY_URL);
pageToRedirectURL = sb.toString();
httpGETAttrName = GCubeSocialNetworking.USER_PROFILE_OID;
httpGETAttrValue = tagged.getName();
} else {
@ -322,7 +326,11 @@ public class Utils {
//returns the VRE url e.g. /devVRE
String vreURL = new LiferayGroupManager().getGroup(theTeam.getGroupId()).getFriendlyURL();
//append the members url
pageToRedirectURL= GCubePortalConstants.PREFIX_GROUP_URL + vreURL + GCubePortalConstants.GROUP_MEMBERS_FRIENDLY_URL;
StringBuilder sb = new StringBuilder(gatewayURL)
.append(GCubePortalConstants.PREFIX_GROUP_URL)
.append(vreURL)
.append(GCubePortalConstants.GROUP_MEMBERS_FRIENDLY_URL);
pageToRedirectURL= sb.toString();
httpGETAttrName = GCubeSocialNetworking.GROUP_MEMBERS_OID;
httpGETAttrValue = tagged.getId();
} catch (Exception e) {
@ -344,7 +352,7 @@ public class Utils {
* @param hashtags
* @return
*/
@Deprecated
public static String convertHashtagsAnchorHTML(String escapedFeedText, List<String> hashtags) {
for (String hashtag : hashtags) {
String taggedHTML = "<a class=\"link\" style=\"font-size:14px;\" href=\"?"+
@ -380,7 +388,7 @@ public class Utils {
* @param text
* @return a String without html tags
*/
@Deprecated
public static String removeHTMLFromText(String text){
if(text == null)