aspose file tools*
The moose likes Java in General and the fly likes How to use the FilenameFilter interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to use the FilenameFilter interface" Watch "How to use the FilenameFilter interface" New topic
Author

How to use the FilenameFilter interface

kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Hi:
This is regarding my previous post,

if I want to include all the xml files in a directy and its sub directory
, say C:\test,

do i just do the following



plz let me know

Many thanks.
Elihu Smails
Ranch Hand

Joined: Jan 12, 2005
Posts: 37
Just write a class that implements FileFilter. Then create a method called accept that takes in a File object and returns a boolean. Inside this method, test the extension. If the extension is ".xml", return true, otherwise, return false.

This is all in the java tutorial...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use the FilenameFilter interface