FileUtils.deleteDirectory
could throw UncheckedIOException
#478
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.
At some point between 2.11.0 and 2.13.0, I think as of 323d376, there seems to have been an incompatible change due to use of
UncheckedIOException
. I found the following from a piece of code callingFileUtils.deleteDirectory
and catching and loggingIOException
, which failed to catch the runtime exception:Never mind the exact reason for the failure of
Files.readAttributes
; something to do with NFS I think. The point is thatdeleteDirectory
should either succeed, or throw some subtype ofIOException
. Reproduced similar behavior in the unit test prior tosrc/main/
fix:I attempted to track all direct or indirect callers of
PathUtils.readAttributes
and make sure they either documentedUncheckedIOException
or translated it toIOException
. I did not attempt to do the same for the many other uses ofUncheck
.