Find Files
Find Files matching your criteria.
Permissions Required
You must have Find permissions to a matching file for it to be included in the results
Method Signature
FilesPage find();
FilesPage find(Filter filter);
FilesPage find(String pageToken);
FilesPage find(Filter filter, String pageToken);
FilesPage find(Filter filter, String pageToken, Integer pageSize);
Parameters
Parameter | Type | Description |
---|---|---|
filter | Filter | The filter criteria to search by, or null to fetch all Files. |
pageToken | String | The token of the page to fetch |
pageSize | Integer | The number of Files to return per page |
returns | FilesPage | The requested page of Files |
You can search for matches among the following attributes of the Where
class.
Name | Type | Description |
---|---|---|
text | String | Fuzzy matches the file Name. |
owner | String | Search for Files created by a specific team member. The email address of the owner of the Instance must match exactly, apart from casing. |
workflowId | UUID | Find Files attached to a specific Workflow |
instanceId | UUID | Find Files attached to a specific Instance |
Example
/*
* This example demonstrates finding all Files in a specific
* Instance uploaded by a particular user.
* This also demonstrates paging through results to collect all
* matches into a single list.
*/
import org.catalytic.sdk.CatalyticClient;
import org.catalytic.sdk.entities.File;
import java.util.List;
import java.util.ArrayList;
public class Program {
public static void main(String[] args) throws Exception {
// Create and initialize Catalytic SDK Client
CatalyticClient catalytic = new CatalyticClient();
List<File> file = new ArrayList<>();
Where where = new Where().instanceId().is("c9f2beec-10c0-4f2f-b4e0-1d884c7e053c")
.and().owner().is("[email protected]");
// Find files that Alice owns for a specific Workflow Instance
FilePage results = catalytic.files().find(where);
file.addAll(results.getFile());
// Loop through all the pages of Files and add them to the Files array
while(results.getNextPageToken() != null) {
results = catalytic.files().find(where, results.getNextPageToken());
file.addAll(results.getFile());
}
}
}
Updated almost 3 years ago