Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improving the File Handling
Future Proofing
I've put all access to files behind a new interface called
AppFile
. At the moment that just returns instances ofTomcatFile
, which is now the sole implementation ofAppFile
. But I foresee a time when we, or a user, might want to run the RIF on another platform, or as a standalone app. If and when that time comes, this change will make it easier to adapt to the new environment.A Single Place for Changes
This change also means that we only have to change one place if application paths change, or other possibilities become available.
File Locking
As well as that I've gone through all the places where files are used and made sure that
Reader
s are closed, and so on.There are a number of places where we pass a
File
object into a library function, so we have to rely on that library being well behaved and closing its resources, but that's just business as usual.So this should fix #108.