W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2009

2006/unicorn/src/org/w3c/unicorn/util ListFiles.java,1.1.2.1,1.1.2.2

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 17 Aug 2009 09:02:27 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Mcy6l-0003y2-Ub@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv15236/src/org/w3c/unicorn/util

Modified Files:
      Tag: dev2
	ListFiles.java 
Log Message:
removed FileNotFoundException if there is no file to return (same behavior as the listFiles() method of java.io.File). now returns null in that case.

Index: ListFiles.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/util/Attic/ListFiles.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- ListFiles.java	11 Aug 2009 16:05:35 -0000	1.1.2.1
+++ ListFiles.java	17 Aug 2009 09:02:25 -0000	1.1.2.2
@@ -36,12 +36,10 @@
 	 * @throws FileNotFoundException
 	 */
 	public static File[] listFiles(final String sDirectory,
-			final String sFilterPattern) throws FileNotFoundException {
+			final String sFilterPattern) {//throws FileNotFoundException {
 		ListFiles.logger.trace("listFiles(String, String)");
-		if (ListFiles.logger.isDebugEnabled()) {
-			ListFiles.logger.debug("Directory : " + sDirectory + ".");
-			ListFiles.logger.debug("Filter pattern : " + sFilterPattern + ".");
-		}
+		ListFiles.logger.trace("Directory : " + sDirectory + ".");
+		ListFiles.logger.trace("Filter pattern : " + sFilterPattern + ".");
 
 		final File aDirectory = new File(sDirectory);
 		final Pattern aPattern = Pattern.compile(sFilterPattern);
@@ -57,15 +55,11 @@
 		};
 
 		final File[] tFile = aDirectory.listFiles(aFilenameFilter);
-		if (null == tFile) {
-			throw new FileNotFoundException("File in " + sDirectory
-					+ " matching pattern " + sFilterPattern + " not found.");
-		}
 		return tFile;
 	}
 
 	/**
-	 * List all filesin a directory
+	 * List all files in a directory
 	 * 
 	 * @param sDirectory
 	 *            the directory to list
Received on Monday, 17 August 2009 09:02:38 UTC

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