diff --git a/.classpath b/.classpath index 79174f7..5cca4e3 100644 --- a/.classpath +++ b/.classpath @@ -15,6 +15,7 @@ + diff --git a/.project b/.project index 03e7ba4..753e8c7 100644 --- a/.project +++ b/.project @@ -5,6 +5,11 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder @@ -15,9 +20,17 @@ + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index ec4300d..443e085 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,8 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..d6f635c --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,5 @@ + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..1b22d70 --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java b/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java index 75a0bb4..b66e05d 100644 --- a/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java +++ b/src/main/java/org/gcube/social_networking/socialutillibrary/Utils.java @@ -37,7 +37,7 @@ public class Utils { * @param preview * @return */ - protected static String convertFileNameAnchorHTML(String url) { + public static String convertFileNameAnchorHTML(String url) { StringBuilder sb = new StringBuilder(); sb.append("shared ").append("a file.").append(" ").toString(); return sb.toString(); @@ -99,7 +99,7 @@ public class Utils { * @param postText * @return the list of hashtags present in the text */ - protected static List getHashTags(String postText) { + public static List getHashTags(String postText) { List hashtags = new ArrayList<>(); Pattern MY_PATTERN = Pattern.compile("^#\\w+|\\s#\\w+"); Matcher matcher = MY_PATTERN.matcher(postText); @@ -114,7 +114,7 @@ public class Utils { * @param feedText * @return the text with the clickable url in it */ - protected static String extractURL(String feedText) { + public static String extractURL(String feedText) { // separate input by spaces ( URLs have no spaces ) feedText = feedText.replaceAll("(\r\n|\n)","
"); String [] parts = feedText.split("\\s"); @@ -142,7 +142,7 @@ public class Utils { * @param html the html string to escape * @return the escaped string */ - protected static String escapeHtmlAndTransformUrl(String html) { + public static String escapeHtmlAndTransformUrl(String html) { if (html == null) { return null; } @@ -164,7 +164,7 @@ public class Utils { * @param html the html string to escape * @return the escaped string */ - protected static String escapeHtml(String html) { + public static String escapeHtml(String html) { return html.replaceAll("&", "&").replaceAll("<", "<") .replaceAll(">", ">"); } @@ -175,7 +175,7 @@ public class Utils { * @param feedText * @return the text with the clickable url in it */ - protected static String transformUrls(String feedText) { + public static String transformUrls(String feedText) { StringBuilder sb = new StringBuilder(); // separate input by spaces ( URLs have no spaces ) String [] parts = feedText.split("\\s"); @@ -206,7 +206,7 @@ public class Utils { * @param item a text token * @return the actual http link */ - private static String getHttpToken(String item) { + public static String getHttpToken(String item) { if (item.startsWith("http") || item.startsWith("www") || item.startsWith("(www") || item.startsWith("(http")) { if (item.startsWith("(")) item = item.substring(1, item.length()); @@ -225,7 +225,7 @@ public class Utils { * @param taggedPeople * @return */ - protected static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList taggedPeople, HttpServletRequest request) { + public static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList taggedPeople, HttpServletRequest request) { String userProfilePageURL = ""; userProfilePageURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL; for (ItemBean tagged : taggedPeople) { @@ -244,7 +244,7 @@ public class Utils { * @param hashtags * @return */ - protected static String convertHashtagsAnchorHTML(String escapedFeedText, List hashtags) { + public static String convertHashtagsAnchorHTML(String escapedFeedText, List hashtags) { for (String hashtag : hashtags) { String taggedHTML = "