java/src/org/apache/qetest/xsl/JiraFileRules.java [170:211]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean accept(File dir, String name)
    {

        // Shortcuts for bogus filenames and dirs
        if (name == null || dir == null)
            return false;

        // Exclude any files that match an exclude rule
        if ((excludeFiles != null) && (excludeFiles.containsKey(name)))
            return false;

        File file = new File(dir, name);
        // Skip any dirs
        if (file.isDirectory())
            return false;
    
        // Only accept files that start with 'jira'
        // HACK: we should really look at the last part of the 
        //  directory name here, but in this one case it's much 
        //  easier to just hard-code the name (this is in 
        //  response to specifying inputDir=tests/jira 
        //  on a Windows platform)
        if (!(name.toLowerCase().startsWith("jira")))
            return false;
            
        // Accept any .java files
        if (name.toLowerCase().endsWith("java"))
            return true;
            
        // If it's a .xsl file..
        if (name.toLowerCase().endsWith("xsl"))
        {
            // Construct matching foo.java from foo.xsl (xsl len = 3)
            File matchingJava = new File(dir, 
                    name.substring(0, (name.length() - 3)) + "java");
            // ..Only accept if matchingJava does not exist        
            return !matchingJava.exists();
        }
            
        // Fall-through: doesn't match, return false
        return false;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/src/org/apache/qetest/xsl/BugzillaFileRules.java [170:211]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean accept(File dir, String name)
    {

        // Shortcuts for bogus filenames and dirs
        if (name == null || dir == null)
            return false;

        // Exclude any files that match an exclude rule
        if ((excludeFiles != null) && (excludeFiles.containsKey(name)))
            return false;

        File file = new File(dir, name);
        // Skip any dirs
        if (file.isDirectory())
            return false;
    
        // Only accept files that start with 'bugzilla'
        // HACK: we should really look at the last part of the 
        //  directory name here, but in this one case it's much 
        //  easier to just hard-code the name (this is in 
        //  response to specifying inputDir=tests/bugzilla 
        //  on a Windows platform)
        if (!(name.toLowerCase().startsWith("bugzilla")))
            return false;
            
        // Accept any .java files
        if (name.toLowerCase().endsWith("java"))
            return true;
            
        // If it's a .xsl file..
        if (name.toLowerCase().endsWith("xsl"))
        {
            // Construct matching foo.java from foo.xsl (xsl len = 3)
            File matchingJava = new File(dir, 
                    name.substring(0, (name.length() - 3)) + "java");
            // ..Only accept if matchingJava does not exist        
            return !matchingJava.exists();
        }
            
        // Fall-through: doesn't match, return false
        return false;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



