FWIW, I dug into the foldertest code looking for the discrepancy between the NFS and local counts and the bug is weird. It seems like when files on an NFS volume have funny characters in Sun’s java.io.FileFilter code is invoked with the File argument of the parent directory instead of the file itself:
Under NFS:
Under /usr/local/export/mp3/Enya/1991 - Shepherd Moons
FILTER: "enya - shepherd moons.m3u" is _NOT_ ok.
FILTER: "01 - enya - shepherd moons.mp3" is ok.
FILTER: "02 - enya - caribbean blue.mp3" is ok.
>>> FILTER: "1991 - shepherd moons" is _NOT_ ok. <<<
FILTER: "03 - enya - how can i keep from singing.mp3" is ok.
FILTER: "05 - enya - angeles.mp3" is ok.
FILTER: "07 - enya - book of days.mp3" is ok.
FILTER: "08 - enya - evacuee.mp3" is ok.
>>> FILTER: "1991 - shepherd moons" is _NOT_ ok. <<<
FILTER: "10 - enya - marble halls.mp3" is ok.
FILTER: "11 - enya - afer ventus.mp3" is ok.
FILTER: "12 - enya - smaointe....mp3" is ok.
FILTER: "cover.jpg" is _NOT_ ok.
FILTER: "06 - enya - no holly for miss quinn.mp3" is ok.
Found 10 directly under /usr/local/export/mp3/Enya/1991 - Shepherd Moons
All the “1991 - shepherd moons” are actually MP3 files that show up fine when reading from a local mount and are parsed successfully by the filter.
It seems like the way File.listFiles works is:
863 public File[] listFiles(FilenameFilter filter)
864 {
865 String[] filelist = list(filter);
866
867 if (filelist == null)
868 return null;
869
870 File[] fobjlist = new File [filelist.length];
871
872 for (int i = 0; i < filelist.length; i++)
873 >>> fobjlist [i] = new File(this, filelist [i]); <<<
874
875 return fobjlist;
876 }
This is lexical – the new array of File objs are created from strings. Looking into the implementation of File.list(null) it seems like it uses something called a VMFile which seems to be returning null for filenames with some unicode chars in them under NFS:
public String[] list(FilenameFilter filter)
758 {
759 checkRead();
760
761 if (!exists() || !isDirectory())
762 return null;
763
764 // Get the list of files
765 String files[] = VMFile.list(path);
766
767 // Check if an error occured in listInternal().
768 if (files == null)
769 return null;
770
771 if (filter == null)
772 return files;
773
774 // Apply the filter
775 int count = 0;
776 for (int i = 0; i < files.length; i++)
777 {
778 >>> if (filter.accept(this, files[i])) <<< // files[i] == null here
779 ++count;
780 else
781 files[i] = null;
782 }
783
784 String[] retfiles = new String[count];
785 count = 0;
786 for (int i = 0; i < files.length; i++)
787 if (files[i] != null)
788 retfiles[count++] = files[i];
789
790 return retfiles;
791 }
I give up, this is job for someone who knows a lot more about java than I.
Anyway, mostly fixed with your latest. Thanks.
Scott