I’m gonna read a file whose name is partially known. Let’s say I have few files like the followings:
- apple_5_34.jpg
- orange_3_67.bmp
- banana_1_13.gif
And I want to get the InputStream to those files when I only know the words “apple”, “orange” or “banana”.
Any suggestion will be greatly appreciated and thanks in advance.
You have 2 options:
Run in loop on all folder content and check
startsWithcase for all 3 defined above names.Or run
regexlike:or
snippets of code