+
+ /** All content providers under this path. */
+ synchronized NavigableMap<String, ContentProvider> findContentProviders(String path) {
+ Map.Entry<String, ContentProvider> floorEntry = partitions.floorEntry(path);
+ if (floorEntry == null)
+ throw new IllegalArgumentException("No floor entry provider found for path '" + path + "'");
+ // we first find the parent provider
+ String parentProviderPath = floorEntry.getKey();
+ // then gather all sub-providers
+ NavigableMap<String, ContentProvider> res = new TreeMap<>();
+ res.put(floorEntry.getKey(), floorEntry.getValue());
+ tail: for (Map.Entry<String, ContentProvider> provider : partitions.tailMap(parentProviderPath).entrySet()) {
+ if (!provider.getKey().startsWith(path))
+ break tail;
+ res.put(provider.getKey(), provider.getValue());
+ }
+ return res;
+
+ }
+