Download a File

Download a File to a temporary file or a given directory or file.

šŸ‘

Permissions Required

You must have permissions to read the field that the file was uploaded to for this request to succeed.

Method Signature

java.io.File Download(String id);
java.io.File Download(String id, String directory);

Parameters

ParameterTypeDescription
idStringThe id of the File to download
directoryStringThe directory to save the download to. The file's
original name will be preserved. Defaults to a local temporary directory.
returnsJava.io.FileThe downloaded File

Example

/*
 * This example demonstrates downloading a File
 */
import org.catalytic.sdk.CatalyticClient;

public class Program {
  
    public static void main(String[] args) throws Exception {
      
      	// Create and initialize Catalytic SDK Client
        CatalyticClient catalytic = new CatalyticClient();
      
      	// Download a specific File by id
        java.io.File file = catalytic.files().download("e6df431b-1041-4326-89e5-1e14caa6a08f");
      	System.out.println("File downloaded to " + file.getAbsolutePath());
    }
}