Virtual File System
FileManagerModule provides a virtual file system that application code can work against. This is an abstraction which allows applications to store and retrieve files without knowing or having to deal with the underlying storage mechanism.
Every file is uniquely identifiable by its FileDescriptor
, this is its URI in the context of FileManagerModule.
Part of the FileDescriptor
is the FolderDescriptor
which uniquely identifies the folder that contains the file.
Every FileDescriptor
is attached to a single FileRepository
, which usually represents separate physical storage.
An application can have many different file repositories, each with a unique id.
The FileManager
is a central service which provides access to all known file repositories.
Usually there is only a single FileManager
component per application.
The FileManager
allows you to save and retrieve files by their FileDescriptor
.
Both FileManager
and FileRepository
always return FileResource
implementations.
This is an additional abstraction through which actual retrieving or saving of file data can be done, as well as performing existence checks.
A file is always located in a single folder, represented by the FolderResource
.
The FolderResource
allows listing or searching files and sub-folders, as well as easy creation of files in the folder.
All components mentioned so far only deal with the actual storage of file data.
FileManagerModule also provides a FileReference
entity which stores file information (metadata) in a relational database, and file data through the FileManager
.
Using FileReference
is optional, the FileManager
infrastructure can be used separately.