On Aug 29, 2013, at 11:15 AM, Alan Bateman <alan.bate...@oracle.com> wrote:

> On 29/08/2013 09:51, Paul Sandoz wrote:
>> On Aug 29, 2013, at 8:58 AM, Alan Bateman<alan.bate...@oracle.com>  wrote:
>> 
>>> :
>>> 
>>> I think I mentioned this previously but in the Files.list/walk/etc. methods 
>>> where you close the resource (on error|runtimeexception) then it's probably 
>>> best to catch the IOException and add it as a suppressed exception.
>>> 
>> Can TWR be used?
>> 
>> try (DirectoryStream<Path>  ds = Files.newDirectoryStream(dir) {
>>     ...
>> }
>> 
> It should be only closed for the error/exception case (as the Stream will 
> keep the directory open).
> 

Doh, i need some coffee...

Paul.


> Henry - Paul's comment reminds of that "one or more" doesn't need to the 
> javadoc for Files.lines as it only opens one directory.
> 
> -Alan.

Reply via email to