@Generated public interface FilesService
The API supports [Unity Catalog volumes], where files and directories to operate on are specified using their volume URI path, which follows the format /Volumes/<catalog_name>/<schema_name>/<volume_name>/<path_to_file>.
The Files API has two distinct endpoints, one for working with files (`/fs/files`) and another one for working with directories (`/fs/directories`). Both endpoints use the standard HTTP methods GET, HEAD, PUT, and DELETE to manage files and directories specified using their URI path. The path is always absolute.
Some Files API client features are currently experimental. To enable them, set `enable_experimental_files_api_client = True` in your configuration profile or use the environment variable `DATABRICKS_ENABLE_EXPERIMENTAL_FILES_API_CLIENT=True`.
Use of Files API may incur Databricks data transfer charges.
[Unity Catalog volumes]: https://docs.databricks.com/en/connect/unity-catalog/volumes.html
This is the high-level interface, that contains generated methods.
Evolving: this interface is under development. Method signatures may change.
| Modifier and Type | Method and Description |
|---|---|
void |
createDirectory(CreateDirectoryRequest createDirectoryRequest)
Creates an empty directory.
|
void |
delete(DeleteFileRequest deleteFileRequest)
Deletes a file.
|
void |
deleteDirectory(DeleteDirectoryRequest deleteDirectoryRequest)
Deletes an empty directory.
|
DownloadResponse |
download(DownloadRequest downloadRequest)
Downloads a file.
|
void |
getDirectoryMetadata(GetDirectoryMetadataRequest getDirectoryMetadataRequest)
Get the metadata of a directory.
|
GetMetadataResponse |
getMetadata(GetMetadataRequest getMetadataRequest)
Get the metadata of a file.
|
ListDirectoryResponse |
listDirectoryContents(ListDirectoryContentsRequest listDirectoryContentsRequest)
Returns the contents of a directory.
|
void |
upload(UploadRequest uploadRequest)
Uploads a file of up to 5 GiB.
|
void createDirectory(CreateDirectoryRequest createDirectoryRequest)
void delete(DeleteFileRequest deleteFileRequest)
void deleteDirectory(DeleteDirectoryRequest deleteDirectoryRequest)
To delete a non-empty directory, first delete all of its contents. This can be done by listing the directory contents and deleting each file and subdirectory recursively.
DownloadResponse download(DownloadRequest downloadRequest)
void getDirectoryMetadata(GetDirectoryMetadataRequest getDirectoryMetadataRequest)
This method is useful to check if a directory exists and the caller has access to it.
If you wish to ensure the directory exists, you can instead use `PUT`, which will create the directory if it does not exist, and is idempotent (it will succeed if the directory already exists).
GetMetadataResponse getMetadata(GetMetadataRequest getMetadataRequest)
ListDirectoryResponse listDirectoryContents(ListDirectoryContentsRequest listDirectoryContentsRequest)
void upload(UploadRequest uploadRequest)
Copyright © 2026. All rights reserved.