FilenameFilter not filtering zip files - Java
<p>I'm implementing a <code>ZipComparison</code> file, which traverses a directory tree structure, and processes the <code>MD5</code> of all the <code>.zip</code> files in that directory tree structure.</p>

<pre><code>import java.io.*;

public class ZipComparison {

public class ZipFilenameFilter implements FilenameFilter {

    public boolean accept(File dir, String name) {
        if( name != null &amp;&amp;
                ( dir.isDirectory() || name.toLowerCase().endsWith(".zip"))) {
            return true;
        }
        return false;
    }
}
/**
 * These two constant values are the root for the directory
 */
private static final String root_a = "D:/UDU/r/tc10.0.0.2012080100_A";
private static final String root_b = "D:/UDU/r/tc10.0.0.2012080100_B";
private ZipFilenameFilter filter;

public ZipComparison() {
     this.filter = new ZipFilenameFilter();
}

public void matchMD5() {
    try{
        File root = new File( ZipComparison.root_a );
        if( !root.exists() ){
            System.out.println( "root doesn't exist" );
        }
        else if( !root.isDirectory() ) {
            System.out.println( "root isn't a directory" );
        }
        else{

            File[] files = new File( ZipComparison.root_a ).listFiles( this.filter );

            if( files != null ){
                showFiles( files );
            }
            else{
                System.out.println( "List of files was null." );
                System.exit( -1 );
            }
        }
    }
    catch(SecurityException ex){
        ex.printStackTrace();
    }
}

/**
 * iterates over the directory tree structure.
 * @param files
 */
public void showFiles( File[] files ){
    for( File file : files ){
        if( file.isDirectory() ) {
            System.out.println( "Directory: " + file.getName() );
            showFiles( file.listFiles( this.filter ) );
        }
        else {
            System.out.println( "File: " + file.getName() );
        }
    }
}
/**
 * @param args
 */
public static void main( String[] args ) {
    // TODO Auto-generated method stub
    ZipComparison zc = new ZipComparison();
    zc.matchMD5();

    System.exit( 0 );
}
</code></pre>

<p>}</p>

<p>When I execute the program without the <code>ZipFilenameFilter filter</code> it works just fine. However, when I add the <code>filter</code> to the </p>

<pre><code>File[] files = new File( ZipComparison.root_a ).listFiles( filter );
</code></pre>

<p>nothing is getting printed out. Am I missing something?</p>
