Get Files

Note: Catalyst now offers you a brand new object storage component called Stratus in Early Access mode. This component is a significant upgrade to the current Cloud Scale File Store component. You can find out more about the Stratus component here.

To use the Stratus component in the Early Access mode, email us at support@zohocatalyst.com.

Get the Metadata of a Specific File

You can retrieve the details of a specific file in the File Store, by passing its unique File ID as an argument to the getFile() method, as shown in the code syntax below. This fetches the file object using which you can retrieve the file’s metadata such as the details of its creation, last modification, file size, etc.

The <FOLDER_INSTANCE> used in the code below is the instance defined in the File Store Instance page.

    
copy
Future<(APIResponse, ZCatalystFile)> <FOLDER_INSTANCE>.getFile(int id)

Parameters:

  • id: The unique File ID of the file to be retrieved

A sample code snippet with the folder instance is shown below:

    
copy
ZCatalystFolder folder = ZCatalystApp.getInstance()
.getFileStoreInstance()
.getFolderInstance(2823000000006561);
try{
var (response, file) = await folder.getFile(2823000000006561);
print('Get File Success');
print('The name of the file is : ${file.name}');
print('The size of the file is : ${file.size}');
} on ZCatalystException catch (ex) {
print(ex.toString);
}

Get the Metadata of all Files

You can retrieve the details of all the files available in a specific folder using the getFiles() method, as shown in the code syntax below.

The <FOLDER_INSTANCE> used in the code below is the instance defined in the Folder Instance page.

    
copy
Future<(APIResponse, List<ZCatalystFile>)> <FOLDER_INSTANCE>.getFiles()

A sample code snippet with the folder instance is shown below:

    
copy
ZCatalystFolder folder = ZCatalystApp.getInstance()
.getFileStoreInstance()
.getFolderInstance(2823000000006561); //Define the folder instance
try{
var (response, files) = await folder.getFiles();
for (var file in files) {
print(file.name); //Actions to be executed upon success
}
} on ZCatalystException catch (ex) {
print(ex.toString());
}

Last Updated 2025-02-24 14:38:44 +0530 +0530

ON THIS PAGE
ACCESS THIS PAGE