Skip to main content

Files

List directories, upload files, and (Java) 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 (Java)

The Java client downloads a file's raw bytes by id:

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

Delete

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