Get Folders

Get the Metadata of a Specific Folder

You can obtain the details of a specific folder in the File Store, by passing its unique Folder ID as an argument to the getFolder() method, as shown in the code syntax below. This fetches the folder object using which you can retrieve the folder’s metadata such as the details of its creation, last modification, and the meta details of the files in it.

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

    
copy
<FILE_STORE_INSTANCE>.getFolder( id: Long, success: (ZCatalystFolder) → Unit, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<ZCatalystFolder>>?

Parameters:

  • id: The unique Folder ID of the folder to be retrieved

A sample code snippet is shown below:

    
copy
ZCatalystApp.getInstance().getFileStoreInstance().getFolder(2823000000006561,//Replace this with your Folder ID { folder -> println("Get Folder Success") println("Folder name: ${folder.name} ") }, { exception -> println("Get Folder Failed! $exception") })

Get the Metadata of all Folders

You can retrieve the details of all the folders available in your project’s File Store using the getFolders() method, as shown in the code syntax below. This can fetch the meta data of all the folders, and the files in them.

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

    
copy
<FILE_STORE_INSTANCE>.getFolders( success: (List<ZCatalystFolder>) → Unit, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<ArrayList<ZCatalystFolder>>>?

A sample code snippet is shown below:

    
copy
ZCatalystApp.getInstance().getFileStoreInstance().getFolders( { folders -> for (folder in folders){ println("Folder names: ${folder.name}") } }, { exception -> println("Get Folders Failed! $exception") } )

Last Updated 2023-09-03 01:06:41 +0530 +0530