The UI5 FS provides a UI5-specific file system abstraction.
The virtual file system "UI5 FS" offers an abstraction layer from the physical file system. Among other features, it can combine a set of scattered file locations into a well-defined virtual structure.
A Resource basically represents a file. Besides providing access to the file content, it also carries metadata like the virtual path of the Resource.
Resources are typically created and stored in Adapters. Once read from a physical file system, they are typically kept in memory for further processing in other modules.
This ensures a high build performance, as physical read and write access for a high number of resources is kept to a minimum.
Adapters abstract access to different resource locations.
The File System Adapter, on the other hand, has direct access to the physical file system. It maps a "virtual base path" to a given physical path.
Both adapters provide APIs to retrieve and persist Resources, namely
- to retrieve a single resource by its virtual path use
- to retrieve many resources based on patterns use
- to persist a single resource use
Reader collections allow grouped access to multiple adapters, which might even be nested in other reader collections.
They implement the same API for retrieving resources as adapters (
byGlob). Multiple flavors exist:
- ReaderCollection: The most basic collection. Allows parallel read access to multiple readers (i.e. adapters or collections)
- ReaderCollectionPrioritized: Contains a list of readers which are searched in-order. This allows one reader to "overlay" resources of another
- DuplexCollection: Contains a single reader and a single "writer". It therefore also implements the Adapter API for persisting resources (
write()). When retrieving resources, the writer is prioritized over the reader
- WriterCollection: Contains a set of writers and a mapping for each of them. When writing a resource, the writer is chosen based on the resource's virtual path.