Early review on NIO Stream APIs
zhong.j.yu at gmail.com
Thu Feb 7 21:10:30 PST 2013
On Thu, Feb 7, 2013 at 10:45 PM, Henry Jen <henry.jen at oracle.com> wrote:
> BiPredicate is a intentional choice, as during the walk process, the attribute is read and many times, filtering is based on file attributes.
> PathMatcher is basically a Predicate<Path>, developer can easily use that in a filter with walk, which return a Stream<Path>.
It's a pity that we don't have an abstraction for Path+Attributes,
since often applications need both.
> Hope that helps.
> On Feb 7, 2013, at 6:53 PM, Zhong Yu <zhong.j.yu at gmail.com> wrote:
>> The find() method uses a
>> BiPredicate<Path, BasicFileAttributes> matcher
>> what about using the existing java.nio.file.PathMatcher interface?
>> There are already some implementations of PathMatcher both in JDK and
>> in the wild.
>> PathMatcher doesn't accept the file attributes though, but that's a
>> problem for most Path-based APIs - path alone often isn't enough and
>> app has to look up attributes in a separate step.
>> Zhong Yu
>> On Thu, Feb 7, 2013 at 6:15 PM, Henry Jen <henry.jen at oracle.com> wrote:
>>> While lambda still finalizing the final API for Stream, there are a
>>> couple of streamifaction APIs in nio area, which I would like to start
>>> circling around to get early feedbacks.
>>> Those APIs return a CloseableStream, other than that, there is not much
>>> directly connection to Stream definition.
>>> The specdiff and webrev is available at
>>> Please include me in the reply as I don't necessary receiving emails
>>> from all aliases.
More information about the lambda-dev