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
Parameter | Type | Description |
---|---|---|
id | String | The id of the File to download |
directory | String | The directory to save the download to. The file's original name will be preserved. Defaults to a local temporary directory. |
returns | Java.io.File | The 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());
}
}
Updated about 3 years ago