Find files in a folder using Java

前端 未结 12 1946
日久生厌
日久生厌 2020-11-28 08:15

What I need to do if Search a folder say C:\\example

I then need to go through each file and check to see if it matches a few start characters so if fil

12条回答
  •  猫巷女王i
    2020-11-28 08:40

    Appache commons IO various

    FilenameUtils.wildcardMatch

    See Apache javadoc here. It matches the wildcard with the filename. So you can use this method for your comparisons.

提交回复
热议问题