W3C home > Mailing lists > Public > www-validator-cvs@w3.org > May 2010

2006/unicorn/src/org/w3c/unicorn/util Templates.java,1.3,1.4

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 14 May 2010 15:22:42 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1OCwio-0002mn-RG@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv10693/src/org/w3c/unicorn/util

Modified Files:
	Templates.java 
Log Message:
the compactor filter can now be deactivated based on USE_HTML_COMPACTOR property of unicorn configuration file

Index: Templates.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/util/Templates.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Templates.java	22 Oct 2009 14:25:20 -0000	1.3
+++ Templates.java	14 May 2010 15:22:40 -0000	1.4
@@ -15,8 +15,12 @@
 	public static void write(String templateName, VelocityContext context, Writer writer) {
 		try {
 			StringWriter sw = new StringWriter();
-			Framework.getVelocityEngine().mergeTemplate(templateName, "UTF-8", context, sw);
-			writer.append(Compactor.compactString(sw.toString(), templateName));
+			if (Property.get("USE_HTML_COMPACTOR").equalsIgnoreCase("true")) {
+				Framework.getVelocityEngine().mergeTemplate(templateName, "UTF-8", context, sw);
+				writer.append(Compactor.compactString(sw.toString(), templateName));
+			} else {
+				Framework.getVelocityEngine().mergeTemplate(templateName, "UTF-8", context, writer);
+			}
 		} catch (ResourceNotFoundException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
Received on Friday, 14 May 2010 15:22:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:42 UTC