Skip to main content

Files

List directories, upload files, and download content. File metadata travels in X-Datahub-* headers, which the SDK percent-encodes for you.

List

DataWrapper<IndexNode> root = client.files().list();
DataWrapper<IndexNode> reports = client.files().list("/reports/2026");

Upload

The Java client uploads raw content bytes to a destination path; the Python and Rust clients upload a local file and a destination_path.

byte[] content = Files.readAllBytes(Path.of("report.csv"));

DataWrapper<IndexNode> uploaded = client.files().upload(
FileUploadRequest.builder()
.path("reports/2026/q2.csv")
.content(content)
.contentType("text/csv") // default: application/octet-stream
.externalId("report_2026_q2") // optional
.dataSetId(42L) // optional
.description("Q2 production") // optional
.build());

Download

All three clients download a file's raw bytes by id. Python and Rust add a streaming variant that writes straight to a path, so a large file never has to sit in memory whole.

byte[] bytes = client.files().download("99");
Files.write(Path.of("q2.csv"), bytes);

Delete

client.files().delete(List.of(IdCollection.createFromExternalId("report_2026_q2")));

What each client covers

OperationJavaPythonRust
List rootfiles().list()files.list_root_directoryfiles.list_root_directory
List a pathfiles().list(path)files.list_directory_by_pathfiles.list_directory_by_path
Uploadfiles().uploadfiles.upload_filefiles.upload_file
Downloadfiles().downloadfiles.download / files.download_to_pathfiles.download / files.download_to_path
Deletefiles().deletefiles.deletefiles.delete

Python and Rust add download_to_path, which streams to disk instead of holding the whole file in memory — see Download.