• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File[] theFiles = aFile.listFiles(aFilenameFilter)

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating a file (that is really a directory) and then calling the listFiles method on the file object passing in an object that implements FilenameFilter. In the accept method FilenameFilter (method that needs to be implemented to implement FilenameFilter) will return true if filename ends on "log". On NT box the listFiles method will return all files that end in "log" in the directory and all sub directories. on unix box returns only files on main directory that ends with "log" but not any files in sub directory.

Any clues?
[This message has been edited by Paul Wetzel (edited November 02, 2000).]
I modified the source so the < symbol would show
[This message has been edited by Carl Trusiak (edited November 02, 2000).]
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What interests me is your implementation of accept. The method definition I see in the docs for 1.1, 1.2 and 1.3 is accept(File file) and you have it implemented as accept(File dir, String filename). Try changing the signiture of your accept and test it again.
Hope this helps
 
Paul Wetzel
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There exists 2 interfaces java.io FileFilter and FilenameFilter in that have a method accept() with different parameters (File aFile) and (File aDir, String fileName) respectively. The former Tests whether or not the specified abstract pathname should be included in a pathname list. The latter Tests if a specified file should be included in a file list. I think I will try the accept(File aFile) and see what happens. I will let you know.
thanks
paul
 
Paul Wetzel
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that didn't change anything...so now i am using recursion to get thje job done.
thanks
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks to me like youv'e run into a bug, you might consider submitting it to Sun's Bug database.
Good Luck
 
reply
    Bookmark Topic Watch Topic
  • New Topic