Upload a File
Upload a one or more new Files to Catalytic.
Returns reference to the uploaded file or a list of the uploaded files.
Method Signature
File upload(java.io.File file);
Parameters
Parameter | Type | Description |
---|---|---|
file | java.io.File | The File to upload |
returns | File | The File object |
Example
/*
* This example demonstrates uploading a File to Cataltyic
*/
import org.catalytic.sdk.CatalyticClient;
import org.catalytic.sdk.entities.File;
public class Program {
public static void main(String[] args) throws Exception {
// Create and initialize the Catalytic SDK Client
CatalyticClient catalytic = new CatalyticClient();
// Upload the file
java.io.File fileToUpload = new File("/path/to/file");
File file = catalytic.files().upload(fileToUpload);
}
}
Updated about 3 years ago