Hi Julia

On 06/03/2020 14:04, Julia Boes wrote:
Hi Anthony,

Thanks for your comments.

For distinguishing the non-default filesystem case, an alternative to using the try-catch block
is an if-else block with the same check as is done in Path::toFile:
    if (path.getFileSystem() == FileSystems.getDefault())

Path::toFile can be overridden so the try-catch block potentially covers more cases.
Good point, I hadn't thought of that.


When setting `length`, the catch clause can be limited to IOException, rather than Exception.
Good catch, changed.

Maybe change the method `RuntimeException toUncheckedException(...)` to `void throwAsUncheckedException(...)` and then instead of `throw toUncheckedException(...)` use `throwAsUncheckedException(...)`

In that case FilePublisher::createInputStream would be missing a return statement. The original version makes it explicit that we always throw something - I'll stick to the original version if that's ok with you.
I see now, thanks, and agree the original version is preferable.
Webrev is updated.

Cheers,

Julia


Kind regards,
Anthony

Reply via email to