How to find files that match a wildcard string in Java?

前端 未结 16 1245
慢半拍i
慢半拍i 2020-11-22 10:52

This should be really simple. If I have a String like this:

../Test?/sample*.txt

then what is a generally-accepted way to get a list of fil

16条回答
  •  半阙折子戏
    2020-11-22 10:56

    The wildcard library efficiently does both glob and regex filename matching:

    http://code.google.com/p/wildcard/

    The implementation is succinct -- JAR is only 12.9 kilobytes.

提交回复
热议问题