xmldb-org / xmldb-api

XML:DB Initiative for XML Databases
Other
13 stars 4 forks source link

[feature request] list collection trees #8

Open line-o opened 2 years ago

line-o commented 2 years ago

It could be useful to have methods that list entire collection subtrees.

Even nicer would be, if the API would provide a method similar to the ls command line tool.

reinhapa commented 2 years ago

@line-o how would the API look like? Any suggestions on how to use it within code?

line-o commented 2 years ago

As noted by @adamretter in Slack it would be beneficial to limit network requests for remote databases. Therefore, there should be exactly one request that will gather all accessible resources and collections (recursively). Your idea of using an interface like FileWalker might not allow that.

In other words we need to limit the capabilities to a set of options that can be set at the initial request that will then tell the remote database which resources it needs to provide.

Sorting can then be done on the client - the code that will handle the list of resources.

line-o commented 2 years ago

I am unsure in which Class this kind of method would fit best. How about a new method in Collection

List<String> list(Map options) throws XMLDBException;
line-o commented 2 years ago

With options including

reinhapa commented 2 years ago

I will give it a taught, maybe something like the nio walk file tree could be an option...