I would actually wrap all the exceptions in this method into an IOException() and bubble it up to the caller instead of System.exit(). If we write something that is not a tool but uses this class, System.exit() would be bad.