exists and notExists
Carfield Yim
carfield at carfield.com.hk
Mon May 26 09:35:46 PDT 2008
On Mon, May 26, 2008 at 9:12 PM, Alan Bateman <Alan.Bateman at sun.com> wrote:
> Elliotte Harold wrote:
>>
>> Why do are there both exists() and notExists() methods in
>> java.nio.file.Path? Is there some subtle issue such that notExists() is not
>> equivalent to !exists()?
>>
>> Otherwise, this feels like unnecessary duplication to me. I'd rather have
>> just the single exists() method.
>>
> An existence check yields one of three answers: the file exists, the file
> does not exist, or it can't say (due a permission problem for example). The
> exists and notExists are convenience methods for cases where you want to
> take action when a file is confirmed to exist (at that point in time), or
> confirmed to not exist.
>
Is that really useful to most of us? Why not enchancing existing API
but duplicate what we have?
More information about the nio-discuss
mailing list