W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2008

2006/unicorn/org/w3c/unicorn Framework.java,1.4,1.5

From: Hiep Duong via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 11 Feb 2008 15:34:19 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1JOafj-0006V5-6s@lionel-hutz.w3.org>

Update of /sources/public/2006/unicorn/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv24968/org/w3c/unicorn

Modified Files:
	Framework.java 
Log Message:
Retreive set of avaiable template language in outputLang

Index: Framework.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/Framework.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Framework.java	22 Jan 2008 13:53:07 -0000	1.4
+++ Framework.java	11 Feb 2008 15:34:17 -0000	1.5
@@ -6,15 +6,21 @@
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileFilter;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import javax.xml.bind.JAXBException;
 import javax.xml.parsers.ParserConfigurationException;
@@ -54,6 +60,8 @@
 
 	public static Properties aPropertiesExtension;
 
+	public static Set<String> outputLang; //list of availables output lang in PATH_TO_OUTPUT_TEMPLATES
+	
 	static {
 		// Load the list of extensions
 		try {
@@ -170,6 +178,7 @@
 			// TODO parser tout les fichiers de taches
 
 			final File[] tFileXML = ListFiles.listFiles(Property.get("PATH_TO_TASKLIST"), "\\.xml");
+
 			final TasksListUnmarshaller aTaskListUnmarshaller =
 				new TasksListUnmarshallerJAXB(Framework.mapOfObserver);
 			for (final File aFile : tFileXML) {
@@ -197,6 +206,19 @@
 			Framework.logger.error("Exception : "+e.getMessage(), e);
 			e.printStackTrace();
 		}
+		
+		/*
+		 * retreive output lang from PATH_TO_OUTPUT_TEMPLATES 
+		 */
+		File[] listFD = (new File(Property.get("PATH_TO_OUTPUT_TEMPLATES"))).listFiles(new FileFilter(){
+			public boolean accept(File pathname) {
+				return pathname.getName().matches(".*\\.vm$");
+			}});
+		outputLang = new HashSet<String>();
+		for (int i=0; i<listFD.length; i++) {
+			outputLang.add((listFD[i].getName().split("_"))[0]);
+		}
+		
 		Framework.logger.info("End of initialisation of UniCORN.");
 	}
 
Received on Monday, 11 February 2008 15:34:32 GMT

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