public class DbfsServiceImpl extends DatabricksService implements DbfsService
client, mapper| Constructor and Description |
|---|
DbfsServiceImpl(DatabricksRestClient client) |
| Modifier and Type | Method and Description |
|---|---|
FileInfoDTO |
getInfo(String path)
Get info of a specific file or directory on dbfs.
|
FileInfoDTO[] |
ls(String path)
Lists files and directories in a dbfs path.
|
void |
mkdirs(String path)
Makes a directory (and parent directories) at a given path.
|
void |
mv(String sourcePath,
String destinationPath)
Moves a file from one path to another.
|
DbfsReadDTO |
read(String path)
Will read a whole file.
|
DbfsReadDTO |
read(String path,
long offset,
long length)
Reads a file from dbfs.
|
void |
rm(String path,
boolean recursive)
Removes a dbfs path.
|
void |
write(String path,
InputStream inputStream,
boolean overwrite)
Will create a file and write to that file on dbfs.
|
public DbfsServiceImpl(DatabricksRestClient client)
public void rm(String path, boolean recursive) throws IOException, DatabricksRestException
DbfsServicerm in interface DbfsServicepath - the path to deleterecursive - whether or not it should be recursiveIOException - any other errorsDatabricksRestException - any errors in requestpublic FileInfoDTO getInfo(String path) throws IOException, DatabricksRestException
DbfsServicegetInfo in interface DbfsServicepath - the dbfs pathIOException - any other errorsDatabricksRestException - any errors in requestpublic FileInfoDTO[] ls(String path) throws IOException, DatabricksRestException
DbfsServicels in interface DbfsServicepath - the dbfs pathIOException - any other errorsDatabricksRestException - any errors in requestpublic void mkdirs(String path) throws IOException, DatabricksRestException
DbfsServicemkdirs in interface DbfsServicepath - the dbfs path to createIOException - any other errorsDatabricksRestException - any errors in requestpublic void mv(String sourcePath, String destinationPath) throws IOException, DatabricksRestException
DbfsServicemv in interface DbfsServicesourcePath - the source dbfs pathdestinationPath - the destination dbfs pathIOException - any other errorsDatabricksRestException - any errors with requestpublic void write(String path, InputStream inputStream, boolean overwrite) throws IOException, DatabricksRestException
DbfsServicewrite in interface DbfsServicepath - the path to create a file/write toinputStream - the stream to output to dbfsoverwrite - whether or not you want to overwrite the fileIOException - if any other errorsDatabricksRestException - any errors in requestpublic DbfsReadDTO read(String path, long offset, long length) throws IOException, DatabricksRestException
DbfsServiceread in interface DbfsServicepath - the dbfs path to read fromoffset - the offset of the file you want to read fromlength - how many bytes you want to readIOException - any other errorsDatabricksRestException - any errors in requestpublic DbfsReadDTO read(String path) throws IOException, DatabricksRestException
DbfsServiceread in interface DbfsServicepath - the dbfs path to read fromIOException - any other errorsDatabricksRestException - any errors in requestCopyright © 2023. All rights reserved.