Sep 7, 2017

You must the close the FileInputStream, as the Properties instance will not. From the Properties.load() javadoc:

The specified stream remains open after this method returns.
Store the FileInputStream in a separate variable, declared outside of the try and add a finally block that closes the FileInputStream if it was opened: