How to check a file if exists with wildcard in Java?

前端 未结 7 684
谎友^
谎友^ 2020-11-27 21:34

I have a directory, and inside it are files are named \"a_id_XXX.zip\".

How do check if a file exists given an id and File dir

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 21:40

    You can use apache WildCardFileFilter

    https://commons.apache.org/proper/commons-io/javadocs/api-1.4/org/apache/commons/io/filefilter/WildcardFileFilter.html

提交回复
热议问题