Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug? FileFilter vs. FilenameFilter



Hi Ralph!

Have you noticed that FileFilter's accept method takes different arguments than FilenameFilter's one?
The former one takes only a File object that describes a file, but the latter one takes a File object that describes a DIRECTORY in which the file was found and a String argument which describes a file name.


So in the first code snippet, each time the accept method is called, the DIRECTORY modification time is checked and, as you've said before, it always returns true. That's the reason why you're getting list of all files in that particular directory.

You can compare this two methods here:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileFilter.html
http://java.sun.com/j2se/1.4.2/docs/api/java/io/FilenameFilter.html

Best regards
Jakub


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.