matlab.io.datastore.FoldersPropertyProvider.populateFoldersFromLocation - Populate Folders property from datastore location argument - MATLAB (original) (raw)
Main Content
Class: matlab.io.datastore.FoldersPropertyProvider
Namespace: matlab.io.datastore
Populate Folders property from datastore location argument
Syntax
populateFoldersFromLocation(ds,location)
Description
populateFoldersFromLocation([ds](#mw%5F65400bc6-f5ba-4624-a75a-a735782dfc57),[location](#mw%5Fc73b4359-531f-4ab7-aa51-d80fdcfda6bc))
populates the Folders
property of the datastore ds
using the location
input to the datastore.
If your custom datastore class inherits from matlab.io.datastore.FoldersPropertyProvider
, then you can callpopulateFoldersFromLocation
in the datastore constructor of the class to populate the Folders
property.
Input Arguments
Location of files or folders in datastore, specified as one of these values:
- A character vector listing a valid folder, file, or wildcard name.
- A string array or cell array of character vectors containing valid folder, file, or wildcard names.
- A
matlab.io.datastore.DsFileSet
object
Examples
If your custom datastore class inherits frommatlab.io.datastore.FoldersPropertyProvider
to add support for aFolders
property, then you can use thepopulateFoldersFromLocation
method in the datastore constructor to populate the Folders
property.
For example, the datastore constructor used in the example Develop Custom Datastore for DICOM Data uses thepopulateFoldersFromLocation
method to populate theFolders
property:
function myds = DICOMDatastore(location)
% The class constructor to set properties of the datastore.
myds.Files = matlab.io.datastore.FileSet(location, ...
"IncludeSubfolders", true);
populateFoldersFromLocation(myds,location);
reset(myds);
end
Version History
Introduced in R2020a