W3C home > Mailing lists > Public > www-validator-cvs@w3.org > July 2007

2002/css-validator/org/w3c/css/servlet CssValidator.java,1.31,1.32

From: Julien Grand-Mourcel via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 30 Jul 2007 12:24:19 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1IFUIN-0007rZ-IS@lionel-hutz.w3.org>

Update of /sources/public/2002/css-validator/org/w3c/css/servlet
In directory hutz:/tmp/cvs-serv30152/org/w3c/css/servlet

Modified Files:
	CssValidator.java 
Log Message:
Correcting the test to make the doPost function working again.
Adding some code to the init function to test if the index pages are up to date.

Index: CssValidator.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/servlet/CssValidator.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- CssValidator.java	20 Jul 2007 06:15:13 -0000	1.31
+++ CssValidator.java	30 Jul 2007 12:24:17 -0000	1.32
@@ -31,6 +31,7 @@
 import org.w3c.css.css.StyleSheetParser;
 import org.w3c.css.error.ErrorReport;
 import org.w3c.css.error.ErrorReportFactory;
+import org.w3c.css.index.IndexGenerator;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.Codecs;
 import org.w3c.css.util.FakeFile;
@@ -124,6 +125,15 @@
 	    && (config.getInitParameter("import").equals("false"))) {
 	    Util.importSecurity = true;
 	}
+	
+	// The following code will check if the index files are missing or outdated
+	// If so, the files will be regenerated
+	// This is done in a Thread so that the validation can carry on.
+	new Thread () {
+		public void run () {
+			IndexGenerator.generatesIndex(true);
+		}
+	}.start();
 
     }
 
@@ -488,7 +498,7 @@
 	} finally {
 	    in.close();
 	}
-
+	
 	try {
 	    buf = new byte[count];
 	    System.arraycopy(general, 0, buf, 0, count);
@@ -525,7 +535,7 @@
 	if (output == null) {
 	    output = texthtml;
 	}
-	if (file == null || file.getSize() == 0 || text == null || text.length() == 0) {
+	if ((file == null || file.getSize() == 0) && (text == null || text.length() == 0)) {
 	    // res.sendError(res.SC_BAD_REQUEST,
 	    // "You have send an invalid request");
 	    handleError(res, ac, output, "No file",
@@ -621,8 +631,6 @@
 				  + title);
 	}
 
-	System.err.println(output);
-
 	// if the output parameter was a mime type, we convert it
 	// to an understandable value for the StyleReportFactory
 	if ("text/xml".equals(ac.getInput()) && texthtml.equals(output)) {
Received on Monday, 30 July 2007 12:24:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:54:58 GMT