[Arakhnę-Dev] [303] * Add ".htm", ".ht" and ".phtml" file extensions in the HTMLFileFilter.

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 303
Author:   galland
Date:     2011-11-05 11:30:31 +0100 (Sat, 05 Nov 2011)
Log Message:
-----------
* Add ".htm", ".ht" and ".phtml" file extensions in the HTMLFileFilter.

Modified Paths:
--------------
    trunk/maventools/src/main/java/org/arakhne/maven/HtmlFileFilter.java

Modified: trunk/maventools/src/main/java/org/arakhne/maven/HtmlFileFilter.java
===================================================================
--- trunk/maventools/src/main/java/org/arakhne/maven/HtmlFileFilter.java	2011-11-05 10:26:52 UTC (rev 302)
+++ trunk/maventools/src/main/java/org/arakhne/maven/HtmlFileFilter.java	2011-11-05 10:30:31 UTC (rev 303)
@@ -42,9 +42,18 @@
 	 */
 	@Override
 	public boolean accept(File pathname) {
-		return pathname!=null &&
-		(pathname.isDirectory() ||
-				pathname.getName().endsWith(".html")); //$NON-NLS-1$
+		if (pathname!=null) {
+			if (pathname.isDirectory()) return true;
+			String basename = pathname.getName();
+			if (basename!=null && basename.length()>0) {
+				basename = basename.toLowerCase();
+				if (basename.endsWith(".html")) return true; //$NON-NLS-1$
+				if (basename.endsWith(".htm")) return true; //$NON-NLS-1$
+				if (basename.endsWith(".ht")) return true; //$NON-NLS-1$
+				if (basename.endsWith(".phtml")) return true; //$NON-NLS-1$
+			}
+		}
+		return false;
 	}
 
 	/**


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/