summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2011-06-09 15:35:31 (EDT)
committerRyan D. Brooks2011-06-09 15:35:31 (EDT)
commit898d9a95a050b6bb38188a998034f9e048554421 (patch)
tree7a873f9960d4be8d713944145a96990669fdc5a3
parentfd9a7a19a0eef1d3a191847a7df6ba022a9458c9 (diff)
downloadorg.eclipse.osee-898d9a95a050b6bb38188a998034f9e048554421.zip
org.eclipse.osee-898d9a95a050b6bb38188a998034f9e048554421.tar.gz
org.eclipse.osee-898d9a95a050b6bb38188a998034f9e048554421.tar.bz2
refactor: Addition of removeComments() to AHTML utility class
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/AHTML.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/AHTML.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/AHTML.java
index 958844c..e4185fe 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/AHTML.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/AHTML.java
@@ -62,6 +62,19 @@ public class AHTML {
return html;
}
+ /**
+ * <p>
+ * Remove (X|HT)ML like comments of form:<br/>
+ * <code>&lt;!--\\s*.*\\s*--&gt;</code><br/>
+ * </p>
+ *
+ * @param value &lt;tagA&gt;&lt;!-- Comment -->aValue&lt;/tagA&gt;
+ * @return &lt;tagA&gt;aValue&lt;/tagA&gt;
+ */
+ public static String removeComments(String value) {
+ return Strings.isValid(value) ? value.replaceAll("<!--\\s*.*\\s*-->", "") : value;
+ }
+
public static String getUrlPageHtml(String urlStr, InetSocketAddress addr) {
StringBuffer buffer = new StringBuffer();
try {