Reading File Metadata

Reading File Metadata

The Backend Services Android SDK provides methods for retrieving metadata about single and multiple files based on an ID or a filter expression. The metadata contains the file's download URL.

Single File

To get a file's metadata by ID, you have to execute the following code snippet:

public File getSingleFileMetadata(EverliveApp app, UUID fileId)
    RequestResult<File> requestResult = app.workWith().files().getById(fileId).executeSync();
    return requestResult.getSuccess() ? requestResult.getValue() : null;

Multiple Files

The get() call returns metadata about all files from the Files content type. In most cases, you will want to apply a filter to limit the results.

The following example returns all files that have been created after a specified point in time. It compares each file's CreatedAt value to a date variable using the where() call.

public ArrayList<File> getMultipleFilesMetadata(EverliveApp app, Date date) {
    RequestResult<ArrayList<File>> requestResult = app.workWith().files().get().
        where(new ValueCondition("CreatedAt", date, ValueConditionOperator.GreaterThan).
    return requestResult.getSuccess() ? requestResult.getValue() : null;

The above code examples refer to the com.telerik.everlive.sdk.core.model.system.File class.

Start a free trial Request a demo
Contact us: +1-888-365-2779
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.