You can store external files in a folder named /static in the same directory as your jar and spring will scan them by default. So if you have static/images/ you can reference your images with:
So you would want to use new File("/static/images/" + imgName);