@ui5/fs/resourceFactory
A collection of resource related APIs
Description: A collection of resource related APIs
Source: fs/lib/resourceFactory.js, line 15
Methods
Description: Creates a resource ReaderWriter.
If a file system base path is given, file system resource ReaderWriter is returned. In any other case a virtual one.
Source: fs/lib/resourceFactory.js, line 41
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Parameters Properties:
|
Returns:
File System- or Virtual Adapter
Type: @ui5/fs/adapters/FileSystem | @ui5/fs/adapters/Memory
Description: Create a Filter-Reader with the given reader. The provided callback is called for every resource that is retrieved through the reader and decides whether the resource shall be passed on or dropped.
Source: fs/lib/resourceFactory.js, line 204
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Properties:
|
Returns:
Reader instance
Type: @ui5/fs/readers/Filter
Description: Create a Link-Reader where all requests are prefixed with /resources/<namespace>.
This simulates "flat" resource access, which is for example common for projects of type "application".
Source: fs/lib/resourceFactory.js, line 250
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Properties:
|
Returns:
Reader instance
Type: @ui5/fs/readers/Link
Description: Create a Link-Reader with the given reader. The provided path mapping allows for rewriting paths segments of all resources passed through it.
import {createLinkReader} from "@ui5/fs/resourceFactory";
const linkedReader = createLinkReader({
reader: sourceReader,
pathMapping: {
linkPath: `/app`,
targetPath: `/resources/my-app-name/`
}
});// The following resolves with a @ui5/fs/ResourceFacade of the resource // located at "/resources/my-app-name/Component.js" in the sourceReader const resource = await linkedReader.byPath("/app/Component.js");
Source: fs/lib/resourceFactory.js, line 233
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Properties:
|
Returns:
Reader instance
Type: @ui5/fs/readers/Link
Description: Creates a File System adapter and wraps it in a ReaderCollection
Source: fs/lib/resourceFactory.js, line 62
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Parameters Properties:
|
Returns:
Reader collection wrapping an adapter
Type: @ui5/fs/ReaderCollection
Description: Creates a ReaderCollection
Source: fs/lib/resourceFactory.js, line 109
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Parameters Properties:
|
Returns:
Reader collection wrapping provided readers
Type: @ui5/fs/ReaderCollection
Description: Creates a ReaderCollectionPrioritized
Source: fs/lib/resourceFactory.js, line 126
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Properties:
|
Returns:
Reader collection wrapping provided readers
Type: @ui5/fs/ReaderCollectionPrioritized
Description: Creates a Resource. Accepts the same parameters as the Resource constructor.
Source: fs/lib/resourceFactory.js, line 158
Parameters:
| Name | Type | Description |
|---|---|---|
parameters | object | Parameters to be passed to the resource constructor |
Returns:
Resource
Type: @ui5/fs/Resource
Description: Creates a Workspace
A workspace is a DuplexCollection which reads from the project sources. It is used during the build process to write modified files into a separate writer, this is usually a Memory adapter. If a file already exists it is fetched from the memory to work on it in further build steps.
Source: fs/lib/resourceFactory.js, line 178
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Properties:
|
Returns:
DuplexCollection which wraps the provided resource locators
Type: @ui5/fs/DuplexCollection
Description: Creates a WriterCollection
Source: fs/lib/resourceFactory.js, line 143
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Properties:
|
Returns:
Writer collection wrapping provided writers
Type: @ui5/fs/WriterCollection

