diff --git a/sdk/storage/inc/datalake/datalake_directory_client.hpp b/sdk/storage/inc/datalake/datalake_directory_client.hpp index b8de51b69..8611a0603 100644 --- a/sdk/storage/inc/datalake/datalake_directory_client.hpp +++ b/sdk/storage/inc/datalake/datalake_directory_client.hpp @@ -72,6 +72,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { */ FileClient GetFileClient(const std::string& path) const; + /** + * @brief Create a DirectoryClient from current DirectoryClient + * @param path Path of the directory under the current directory. + * @return DirectoryClient + */ + DirectoryClient GetSubDirectoryClient(const std::string& path) const; + /** * @brief Gets the directory's primary uri endpoint. This is the endpoint used for blob * storage available features in DataLake. diff --git a/sdk/storage/src/datalake/datalake_directory_client.cpp b/sdk/storage/src/datalake/datalake_directory_client.cpp index 6f3e3746a..c98ecab1f 100644 --- a/sdk/storage/src/datalake/datalake_directory_client.cpp +++ b/sdk/storage/src/datalake/datalake_directory_client.cpp @@ -131,6 +131,15 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { return FileClient(std::move(builder), std::move(blobClient), m_pipeline); } + DirectoryClient DirectoryClient::GetSubDirectoryClient(const std::string& path) const + { + auto builder = m_dfsUri; + builder.AppendPath(path, true); + auto blobClient = m_blobClient; + blobClient.m_blobUrl.AppendPath(path, true); + return DirectoryClient(std::move(builder), std::move(blobClient), m_pipeline); + } + Azure::Core::Response DirectoryClient::Rename( const std::string& destinationPath, const RenameDirectoryOptions& options) const