DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=30992>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=30992 DirectoryFileFilter does not work, the AbstractFileFilter bug Summary: DirectoryFileFilter does not work, the AbstractFileFilter bug Product: Commons Version: 1.0 Final Platform: PC OS/Version: Windows XP Status: NEW Severity: Normal Priority: Other Component: IO AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Env: Java 1.4.2, commons-io-1.0.jar, Win XP The AbstractFileFilter's FilenameFilter's accept(File, String) method implementation constructs the fileName/File (it passes to accept(File)) wrongly - please see below. This causes the DirectoryFileFilter (in example, I did not have time to check out the other AbstractFileFilter implementations) failure since it's FileFilter implementation receives the incorrect filename/File. Note I stumbled into this in Win Env. and really don't know how it works in other platforms. v1.0 code: public boolean accept(File dir, String name) { String filename = dir.getName() + File.separator + name; return accept(new File(filename)); } correct code should be: public boolean accept(File dir, String name) { String filename = dir.getPath() + File.separator + name; return accept(new File(filename)); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
