By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

find file by mask

P: n/a
hello one and all,

still new to java, day 12 now, but liking a bit more each day. how
would i do this in java.

say i want to see of the files of type "*.zip" in or under the directory
"/home/lucas". or, i want to see the file names of those with the
extension "zip" along with either their respective full or relative
paths to each of those files under that directory "/home/lucas".

what is the best method to do this in java? please provide a code
snippet as an example. thank you in advance and have a great easter
weekend.

lucas

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
One way to do this is to use a java.io.FilenameFilter. The java.io
package offers many ways to interact with the file system. Real
Gagnon has posted an example use of a FilenameFilter:

http://www.rgagnon.com/javadetails/java-0055.html

Real has a lot of great coding examples on his site:

http://www.rgagnon.com/howto.html

HTH
- Glenn
slukacs <sl*****@adelphia.net> wrote in message news:<mr********************@adelphia.com>...
hello one and all,

still new to java, day 12 now, but liking a bit more each day. how
would i do this in java.

say i want to see of the files of type "*.zip" in or under the directory
"/home/lucas". or, i want to see the file names of those with the
extension "zip" along with either their respective full or relative
paths to each of those files under that directory "/home/lucas".

what is the best method to do this in java? please provide a code
snippet as an example. thank you in advance and have a great easter
weekend.

lucas

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.