Correctly handling Exception: java.nio.file.FileSystemException: No space left on device.
By default methods File.makeDir() and File.makeDirs() can return 'false' if file aleady exists or can not be created. Such silent ignore of the situation propagates misbehavior to the caller: CacheDataSink#173 : new FileOutputStream(file). And then it throws not correct exception type 'FileNotFoundException'. While correct exception should be 'no space left on the device'. This can be fixed only with 'Files.createDirectories()' method that throws correct exception type.
Showing
with
20 additions
and
2 deletions
Please
register
or
sign in
to comment