Skip to content

Commit

Permalink
[INTERNAL] resourceFactory: Add createReaderCollection API
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Apr 22, 2022
1 parent dff7195 commit aeb65bc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/resourceFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,30 @@ const resourceFactory = {
}
},

/**
* Creates an adapter and wraps it in a ReaderCollection
*
* @public
* @param {object} parameters Parameters
* @param {string} parameters.virBasePath Virtual base path
* @param {string} [parameters.fsBasePath] File system base path
* @param {string} [parameters.name] Name for the reader collection
* @returns {module:@ui5/fs.ReaderCollection} Reader collection wrapping an adapter
*/
createReader({fsBasePath, virBasePath, name}) {
return new ReaderCollection({
name,
readers: [resourceFactory.createAdapter({fsBasePath, virBasePath})]
});
},

createReaderCollection({name, readers}) {
return new ReaderCollection({
name,
readers
});
},

/**
* Creates a <code>Resource</code>. Accepts the same parameters as the Resource constructor.
*
Expand Down

0 comments on commit aeb65bc

Please sign in to comment.