@Generated public interface DbfsService
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 |
addBlock(AddBlock addBlock)
Appends a block of data to the stream specified by the input handle.
|
void |
close(Close close)
Closes the stream specified by the input handle.
|
CreateResponse |
create(Create create)
Opens a stream to write to a file and returns a handle to this stream.
|
void |
delete(Delete delete)
Delete the file or directory (optionally recursively delete all files in the directory).
|
FileInfo |
getStatus(GetStatusRequest getStatusRequest)
Gets the file information for a file or directory.
|
ListStatusResponse |
list(ListDbfsRequest listDbfsRequest)
List the contents of a directory, or details of the file.
|
void |
mkdirs(MkDirs mkDirs)
Creates the given directory and necessary parent directories if they do not exist.
|
void |
move(Move move)
Moves a file from one location to another location within DBFS.
|
void |
put(Put put)
Uploads a file through the use of multipart form post.
|
ReadResponse |
read(ReadDbfsRequest readDbfsRequest)
Returns the contents of a file.
|
void addBlock(AddBlock addBlock)
If the block of data exceeds 1 MB, this call will throw an exception with ``MAX_BLOCK_SIZE_EXCEEDED``.
void close(Close close)
CreateResponse create(Create create)
A typical workflow for file upload would be:
1. Issue a ``create`` call and get a handle. 2. Issue one or more ``add-block`` calls with the handle you have. 3. Issue a ``close`` call with the handle you have.
void delete(Delete delete)
When you delete a large number of files, the delete operation is done in increments. The call returns a response after approximately 45 seconds with an error message (503 Service Unavailable) asking you to re-invoke the delete operation until the directory structure is fully deleted.
For operations that delete more than 10K files, we discourage using the DBFS REST API, but advise you to perform such operations in the context of a cluster, using the [File system utility (dbutils.fs)](/dev-tools/databricks-utils.html#dbutils-fs). `dbutils.fs` covers the functional scope of the DBFS REST API, but from notebooks. Running such operations using notebooks provides better control and manageability, such as selective deletes, and the possibility to automate periodic delete jobs.
FileInfo getStatus(GetStatusRequest getStatusRequest)
ListStatusResponse list(ListDbfsRequest listDbfsRequest)
When calling list on a large directory, the list operation will time out after approximately 60 seconds. We strongly recommend using list only on directories containing less than 10K files and discourage using the DBFS REST API for operations that list more than 10K files. Instead, we recommend that you perform such operations in the context of a cluster, using the [File system utility (dbutils.fs)](/dev-tools/databricks-utils.html#dbutils-fs), which provides the same functionality without timing out.
void mkdirs(MkDirs mkDirs)
void move(Move move)
void put(Put put)
Alternatively you can pass contents as base64 string.
The amount of data that can be passed (when not streaming) using the __contents__ parameter is limited to 1 MB. `MAX_BLOCK_SIZE_EXCEEDED` will be thrown if this limit is exceeded.
If you want to upload large files, use the streaming upload. For details, see :method:dbfs/create, :method:dbfs/addBlock, :method:dbfs/close.
ReadResponse read(ReadDbfsRequest readDbfsRequest)
If `offset + length` exceeds the number of bytes in a file, it reads the contents until the end of file.
Copyright © 2026. All rights reserved.