On 29/01/2016 17:39, Paul Sandoz wrote:
:
Alan’s point is that traversing using entries()/stream() always returns the
versioned entries (if any) rather than all entries, thus in a sense filters.
My assumption was the traversal should by default be consistent with a calls to
getEntry, thus:
jarFile.stream().forEach(e -> {
JarEntry je = jarFile.getJarEntry(e.getName());
assert e.equals(je);
});
There might need to be another stream method that returns all entries.
Right, I'm mostly just wondering if entries()/streams() should override
the entries in the stream with versioned entries and filter out the
META-INF/versions/ tree.
If I've gone to trouble of specifying the a Release then it seems the
right thing to do. On the other hand, it comes at a cost and there will
be use-cases like "get the names of all entries" that would be more
efficient to just build on the current entries()/stream(). I'm loath to
suggest this might need a new method but it might be one of the options
to consider here. Minimally there is a javadoc to specify on how these
methods behave when the JAR is multi-release and opened by specifying a
release.
-Alan