Package org.rapidcontext.core.storage
Class Query
java.lang.Object
org.rapidcontext.core.storage.Query
A storage query for streaming metadata or data results. Searches
are performed depth-first and will only returns objects (or their
metadata), omitting indices.
- Version:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a path predicate filter to all results.filterAccess(String permission) Adds an access filter (for current user) to all results.filterDepth(int depth) Adds a path depth filter to all results.Adds a file name extension filter to all results.filterShowHidden(boolean hidden) Toggle hidden path inclusion in results (defaults to false).Returns the stream of metadata found.Returns the stream of metadata found for objects of a specified type.objects()Returns the stream of objects found.<T> Stream<T> Returns the stream of objects found of a specified type.paths()Returns the stream of matching object paths.
-
Constructor Details
-
Query
Creates a new query for the specified storage.- Parameters:
storage- the storage to querybase- the base path
-
-
Method Details
-
filter
Adds a path predicate filter to all results.- Parameters:
predicate- the predicate to filter with- Returns:
- this query instance
-
filterShowHidden
Toggle hidden path inclusion in results (defaults to false).- Parameters:
hidden- include hidden paths- Returns:
- this query instance
-
filterDepth
Adds a path depth filter to all results. A depth of zero (0) will only match child paths directly on the base path.- Parameters:
depth- the additional depth, or -1 for any- Returns:
- this query instance
-
filterFileExtension
Adds a file name extension filter to all results.- Parameters:
ext- the file extension to match- Returns:
- this query instance
-
filterAccess
Adds an access filter (for current user) to all results.- Parameters:
permission- the permission to require- Returns:
- this query instance
-
paths
Returns the stream of matching object paths.- Returns:
- the stream of matching object paths
-
metadatas
Returns the stream of metadata found.- Returns:
- the stream of metadata found
-
metadatas
Returns the stream of metadata found for objects of a specified type.- Parameters:
clazz- the class required for objects- Returns:
- the stream of metadata found
-
objects
Returns the stream of objects found.- Returns:
- the stream of objects found
-
objects
Returns the stream of objects found of a specified type.- Type Parameters:
T- the type to cast objects to- Parameters:
clazz- the class required for objects- Returns:
- the stream of objects found
-