for(int i=0;i!=nentries;++i) {
Path.Item item = contents[i];
if (item instanceof Entry) {
Entry entry = (Entry) item;
if (filter.matches(entry.id(), entry.contentType())) {
entries.add(entry.id());
}
} else if (item instanceof Path.Folder
&& filter.matchesSubpath(item.id())) {
Path.Folder folder = (Path.Folder) item;