...
Notice how Throwable
is caught instead of specific exceptions. This is a departure from commonly suggested best practices, but is critical in cases where runtime exceptions or errors can reveal sensitive information. Moreover, this solution overcomes the issue of the brute force attack described earlier by accepting a denumerable set of file name choices with the aid of a switch-case
clause. The actual file names and paths are thus as a result shielded from the user of the application.
...