File directories
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Wednesday, June 12, 2002 07:49 AM

I'm wanting to write a class that will open a specified directory and begin looking for files with a certain name plus an index number. Does anyone know any usefull documentation on such a topic? Thanks.

Re: File directories

Posted By:   Sean_Ruff  
Posted On:   Wednesday, June 12, 2002 08:10 AM

Use the listFiles[] method in the File class which allows you to pass in a FilenameFilter as an argument. You will have to create your own implementation of a FilenameFilter (anonymous class or otherwise) to do what you are looking for. A FilenameFilter gets the name of the file passed in, from there you can just use String methods to determine if it meets your requirements and return true/false;

Hope this helps.
About | Sitemap | Contact