java filenames filter pattern

Posted by Sergey on Stack Overflow See other posts from Stack Overflow or by Sergey
Published on 2010-06-16T22:27:38Z Indexed on 2010/06/16 22:32 UTC
Read the original article Hit count: 269

Filed under:
|
|
|

Hello, I need to implement

File[] files = getFiles( String folderName, String ptrn );

Where ptrn is a command prompt style pattern like "*2010*.txt"

I'm familar with FilenameFilter class, but can't implement public boolean accept(File dir, String filename) because String.matches() doesn't accept such patterns.

Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about filter