close file after reading it to make sure JUnit is able to delete the resource