FileManagerModule supports folders for organizing file resources. A single folder can contain file resources or other folder resources.
FolderDescriptor is the URI of a single folder resource in the system.
FileDescriptor it can be represented as a string, for example:
FolderDescriptor is made up of two segments:
- Repository id
The unique id of the
FileRepositorywhere this file is located (
my-repository). A repository id is always required.
- Folder id
The id of the folder in the repository.
Most characters are allowed in descriptor segments, with the following exceptions:
colon (:) is not allowed
backward slash (\) will always be replaced by forward slash (/)
In the string representation the different segments are separated with a colon.
|URI||Repository id||Folder id|
|A folder descriptor URI should always end with a training forward slash (/).|
Parsing a string URI to a
FolderDescriptor can be done with
FolderDescriptor.of( "my-repository:folder/" )
FolderDescriptor.toString() will give you the normalized string representation.
FileRepository has a virtual root folder, in which the file resources without a specific folder id will be located.
The folder id of a root folder is always
A descriptor for a root folder can be created using
FolderDescriptor.rootFolder( "repository-id" ).
FolderDescriptor is always part of a
FileDescriptor and can be retrieved with
FileDescriptor.getFolderId() might return a
null value for the root folder, a
FolderDescriptor will never be
The descriptor contains the entire folder hierarchy as path segments separated with a forward slash (/).
The descriptor of the parent folder can be retrieved using
The latter returns an
Optional<FolderDescriptor> which will be empty if the current descriptor represents the root folder of the repository.