Renamed GetUri to GetUrl. (#1414)
This commit is contained in:
parent
66538df833
commit
e2a49a127b
@ -10,6 +10,7 @@
|
||||
|
||||
- Removed `GetDfsUri` in all clients since they are currently implementation details.
|
||||
- `DataLakePathClient` can no longer set permissions with `SetAccessControl`, instead, a new API `SetPermissions` is created for such functionality. Renamed the original API to `SetAccessControlList` to be more precise.
|
||||
- Renamed `GetUri` to `GetUrl`.
|
||||
|
||||
## 12.0.0-beta.6 (2020-01-14)
|
||||
|
||||
|
||||
@ -81,12 +81,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeDirectoryClient GetSubdirectoryClient(const std::string& subdirectoryName) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the directory's primary uri endpoint. This is the endpoint used for blob
|
||||
* @brief Gets the directory's primary url endpoint. This is the endpoint used for blob
|
||||
* storage available features in DataLake.
|
||||
*
|
||||
* @return The directory's primary uri endpoint.
|
||||
* @return The directory's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_blobClient.GetUrl(); }
|
||||
std::string GetUrl() const { return m_blobClient.GetUrl(); }
|
||||
|
||||
/**
|
||||
* @brief Create a directory. By default, the destination is overwritten and
|
||||
@ -181,10 +181,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
private:
|
||||
explicit DataLakeDirectoryClient(
|
||||
Azure::Core::Http::Url dfsUri,
|
||||
Azure::Core::Http::Url dfsUrl,
|
||||
Blobs::BlobClient blobClient,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: DataLakePathClient(std::move(dfsUri), std::move(blobClient), pipeline)
|
||||
: DataLakePathClient(std::move(dfsUrl), std::move(blobClient), pipeline)
|
||||
{
|
||||
}
|
||||
friend class DataLakeFileSystemClient;
|
||||
|
||||
@ -68,12 +68,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the file's primary uri endpoint. This is the endpoint used for blob
|
||||
* @brief Gets the file's primary url endpoint. This is the endpoint used for blob
|
||||
* storage available features in DataLake.
|
||||
*
|
||||
* @return The file's primary uri endpoint.
|
||||
* @return The file's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_blockBlobClient.GetUrl(); }
|
||||
std::string GetUrl() const { return m_blockBlobClient.GetUrl(); }
|
||||
|
||||
/**
|
||||
* @brief Uploads data to be appended to a file. Data can only be appended to a file.
|
||||
@ -260,11 +260,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Blobs::BlockBlobClient m_blockBlobClient;
|
||||
|
||||
explicit DataLakeFileClient(
|
||||
Azure::Core::Http::Url dfsUri,
|
||||
Azure::Core::Http::Url dfsUrl,
|
||||
Blobs::BlobClient blobClient,
|
||||
Blobs::BlockBlobClient blockBlobClient,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: DataLakePathClient(std::move(dfsUri), std::move(blobClient), pipeline),
|
||||
: DataLakePathClient(std::move(dfsUrl), std::move(blobClient), pipeline),
|
||||
m_blockBlobClient(std::move(blockBlobClient))
|
||||
{
|
||||
}
|
||||
|
||||
@ -90,12 +90,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeDirectoryClient GetDirectoryClient(const std::string& directoryName) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the filesystem's primary uri endpoint. This is the endpoint used for blob
|
||||
* @brief Gets the filesystem's primary url endpoint. This is the endpoint used for blob
|
||||
* storage available features in DataLake.
|
||||
*
|
||||
* @return The filesystem's primary uri endpoint.
|
||||
* @return The filesystem's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_blobContainerClient.GetUrl(); }
|
||||
std::string GetUrl() const { return m_blobContainerClient.GetUrl(); }
|
||||
|
||||
/**
|
||||
* @brief Creates the file system.
|
||||
@ -178,15 +178,15 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const ListPathsSinglePageOptions& options = ListPathsSinglePageOptions()) const;
|
||||
|
||||
private:
|
||||
Azure::Core::Http::Url m_dfsUri;
|
||||
Azure::Core::Http::Url m_dfsUrl;
|
||||
Blobs::BlobContainerClient m_blobContainerClient;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
|
||||
explicit DataLakeFileSystemClient(
|
||||
Azure::Core::Http::Url dfsUri,
|
||||
Azure::Core::Http::Url dfsUrl,
|
||||
Blobs::BlobContainerClient blobContainerClient,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: m_dfsUri(std::move(dfsUri)), m_blobContainerClient(std::move(blobContainerClient)),
|
||||
: m_dfsUrl(std::move(dfsUrl)), m_blobContainerClient(std::move(blobContainerClient)),
|
||||
m_pipeline(std::move(pipeline))
|
||||
{
|
||||
}
|
||||
|
||||
@ -69,12 +69,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const DataLakeClientOptions& options = DataLakeClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the path's primary uri endpoint. This is the endpoint used for blob
|
||||
* @brief Gets the path's primary url endpoint. This is the endpoint used for blob
|
||||
* storage available features in DataLake.
|
||||
*
|
||||
* @return The path's primary uri endpoint.
|
||||
* @return The path's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_blobClient.GetUrl(); }
|
||||
std::string GetUrl() const { return m_blobClient.GetUrl(); }
|
||||
|
||||
/**
|
||||
* @brief Creates a file or directory. By default, the destination is overwritten and
|
||||
@ -281,15 +281,15 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
|
||||
protected:
|
||||
Azure::Core::Http::Url m_dfsUri;
|
||||
Azure::Core::Http::Url m_dfsUrl;
|
||||
Blobs::BlobClient m_blobClient;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
|
||||
explicit DataLakePathClient(
|
||||
Azure::Core::Http::Url dfsUri,
|
||||
Azure::Core::Http::Url dfsUrl,
|
||||
Blobs::BlobClient blobClient,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: m_dfsUri(std::move(dfsUri)), m_blobClient(std::move(blobClient)),
|
||||
: m_dfsUrl(std::move(dfsUrl)), m_blobClient(std::move(blobClient)),
|
||||
m_pipeline(std::move(pipeline))
|
||||
{
|
||||
}
|
||||
|
||||
@ -71,12 +71,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeFileSystemClient GetFileSystemClient(const std::string& fileSystemName) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the datalake service's primary uri endpoint. This is the endpoint used for blob
|
||||
* @brief Gets the datalake service's primary url endpoint. This is the endpoint used for blob
|
||||
* storage available features in DataLake.
|
||||
*
|
||||
* @return The datalake service's primary uri endpoint.
|
||||
* @return The datalake service's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_blobServiceClient.GetUrl(); }
|
||||
std::string GetUrl() const { return m_blobServiceClient.GetUrl(); }
|
||||
|
||||
/**
|
||||
* @brief List the file systems from the service.
|
||||
@ -111,7 +111,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
|
||||
private:
|
||||
Azure::Core::Http::Url m_dfsUri;
|
||||
Azure::Core::Http::Url m_dfsUrl;
|
||||
Blobs::BlobServiceClient m_blobServiceClient;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
};
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace DataLake { namespace Details {
|
||||
|
||||
std::string GetBlobUriFromUri(const std::string& uri);
|
||||
std::string GetDfsUriFromUri(const std::string& uri);
|
||||
std::string GetBlobUrlFromUrl(const std::string& url);
|
||||
std::string GetDfsUrlFromUrl(const std::string& url);
|
||||
|
||||
std::string SerializeMetadata(const Storage::Metadata& dataLakePropertiesMap);
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -85,7 +85,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -114,7 +114,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -128,7 +128,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
DataLakeFileClient DataLakeDirectoryClient::GetFileClient(const std::string& fileName) const
|
||||
{
|
||||
auto builder = m_dfsUri;
|
||||
auto builder = m_dfsUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(fileName));
|
||||
auto blobClient = m_blobClient;
|
||||
blobClient.m_blobUrl.AppendPath(Storage::Details::UrlEncodePath(fileName));
|
||||
@ -140,7 +140,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeDirectoryClient DataLakeDirectoryClient::GetSubdirectoryClient(
|
||||
const std::string& subdirectoryName) const
|
||||
{
|
||||
auto builder = m_dfsUri;
|
||||
auto builder = m_dfsUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(subdirectoryName));
|
||||
auto blobClient = m_blobClient;
|
||||
blobClient.m_blobUrl.AppendPath(Storage::Details::UrlEncodePath(subdirectoryName));
|
||||
@ -154,11 +154,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Nullable<std::string> destinationFileSystem = options.DestinationFileSystem;
|
||||
if (!destinationFileSystem.HasValue() || destinationFileSystem.GetValue().empty())
|
||||
{
|
||||
const auto& currentPath = m_dfsUri.GetPath();
|
||||
const auto& currentPath = m_dfsUrl.GetPath();
|
||||
std::string::const_iterator cur = currentPath.begin();
|
||||
destinationFileSystem = Details::GetSubstringTillDelimiter('/', currentPath, cur);
|
||||
}
|
||||
auto destinationDfsUri = m_dfsUri;
|
||||
auto destinationDfsUri = m_dfsUrl;
|
||||
destinationDfsUri.SetPath(destinationFileSystem.GetValue() + '/' + destinationPath);
|
||||
|
||||
Details::DataLakeRestClient::Path::CreateOptions protocolLayerOptions;
|
||||
@ -174,7 +174,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.SourceIfNoneMatch = options.SourceAccessConditions.IfNoneMatch;
|
||||
protocolLayerOptions.SourceIfModifiedSince = options.SourceAccessConditions.IfModifiedSince;
|
||||
protocolLayerOptions.SourceIfUnmodifiedSince = options.SourceAccessConditions.IfUnmodifiedSince;
|
||||
protocolLayerOptions.RenameSource = "/" + m_dfsUri.GetPath();
|
||||
protocolLayerOptions.RenameSource = "/" + m_dfsUrl.GetPath();
|
||||
auto result = Details::DataLakeRestClient::Path::Create(
|
||||
destinationDfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
// At this point, there is not more exception thrown, meaning the rename is successful.
|
||||
@ -220,7 +220,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.ForceFlag = options.ForceFlag;
|
||||
protocolLayerOptions.Acl = Models::Acl::SerializeAcls(acls);
|
||||
return Details::DataLakeRestClient::Path::SetAccessControlRecursive(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::DataLake
|
||||
|
||||
@ -123,7 +123,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -154,7 +154,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -184,7 +184,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -218,7 +218,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::DataLakeRestClient::Path::AppendData(
|
||||
m_dfsUri, *content, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *content, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::FlushDataLakeFileDataResult> DataLakeFileClient::FlushData(
|
||||
@ -247,7 +247,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
|
||||
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
return Details::DataLakeRestClient::Path::FlushData(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::RenameDataLakeFileResult> DataLakeFileClient::Rename(
|
||||
@ -257,11 +257,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Nullable<std::string> destinationFileSystem = options.DestinationFileSystem;
|
||||
if (!destinationFileSystem.HasValue() || destinationFileSystem.GetValue().empty())
|
||||
{
|
||||
const auto& currentPath = m_dfsUri.GetPath();
|
||||
const auto& currentPath = m_dfsUrl.GetPath();
|
||||
std::string::const_iterator cur = currentPath.begin();
|
||||
destinationFileSystem = Details::GetSubstringTillDelimiter('/', currentPath, cur);
|
||||
}
|
||||
auto destinationDfsUri = m_dfsUri;
|
||||
auto destinationDfsUri = m_dfsUrl;
|
||||
destinationDfsUri.SetPath(destinationFileSystem.GetValue() + '/' + destinationPath);
|
||||
|
||||
Details::DataLakeRestClient::Path::CreateOptions protocolLayerOptions;
|
||||
@ -276,7 +276,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.SourceIfNoneMatch = options.SourceAccessConditions.IfNoneMatch;
|
||||
protocolLayerOptions.SourceIfModifiedSince = options.SourceAccessConditions.IfModifiedSince;
|
||||
protocolLayerOptions.SourceIfUnmodifiedSince = options.SourceAccessConditions.IfUnmodifiedSince;
|
||||
protocolLayerOptions.RenameSource = "/" + m_dfsUri.GetPath();
|
||||
protocolLayerOptions.RenameSource = "/" + m_dfsUrl.GetPath();
|
||||
auto result = Details::DataLakeRestClient::Path::Create(
|
||||
destinationDfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
// At this point, there is not more exception thrown, meaning the rename is successful.
|
||||
|
||||
@ -34,7 +34,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
blobOptions.RetryOptions = options.RetryOptions;
|
||||
blobOptions.RetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetBlobUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetBlobUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
return blobOptions;
|
||||
}
|
||||
} // namespace
|
||||
@ -63,9 +63,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& fileSystemUri,
|
||||
std::shared_ptr<StorageSharedKeyCredential> credential,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(fileSystemUri)),
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(fileSystemUri)),
|
||||
m_blobContainerClient(
|
||||
Details::GetBlobUriFromUri(fileSystemUri),
|
||||
Details::GetBlobUrlFromUrl(fileSystemUri),
|
||||
credential,
|
||||
GetBlobContainerClientOptions(options))
|
||||
{
|
||||
@ -80,7 +80,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -98,9 +98,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& fileSystemUri,
|
||||
std::shared_ptr<Core::TokenCredential> credential,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(fileSystemUri)),
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(fileSystemUri)),
|
||||
m_blobContainerClient(
|
||||
Details::GetBlobUriFromUri(fileSystemUri),
|
||||
Details::GetBlobUrlFromUrl(fileSystemUri),
|
||||
credential,
|
||||
GetBlobContainerClientOptions(options))
|
||||
{
|
||||
@ -114,7 +114,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -132,9 +132,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeFileSystemClient::DataLakeFileSystemClient(
|
||||
const std::string& fileSystemUri,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(fileSystemUri)),
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(fileSystemUri)),
|
||||
m_blobContainerClient(
|
||||
Details::GetBlobUriFromUri(fileSystemUri),
|
||||
Details::GetBlobUrlFromUrl(fileSystemUri),
|
||||
GetBlobContainerClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -147,7 +147,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -162,7 +162,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
DataLakePathClient DataLakeFileSystemClient::GetPathClient(const std::string& path) const
|
||||
{
|
||||
auto builder = m_dfsUri;
|
||||
auto builder = m_dfsUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(path));
|
||||
return DataLakePathClient(builder, m_blobContainerClient.GetBlobClient(path), m_pipeline);
|
||||
}
|
||||
@ -170,7 +170,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeFileClient DataLakeFileSystemClient::GetFileClient(const std::string& fileName) const
|
||||
{
|
||||
|
||||
auto builder = m_dfsUri;
|
||||
auto builder = m_dfsUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(fileName));
|
||||
auto blobClient = m_blobContainerClient.GetBlobClient(fileName);
|
||||
auto blockBlobClient = blobClient.AsBlockBlobClient();
|
||||
@ -181,7 +181,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeDirectoryClient DataLakeFileSystemClient::GetDirectoryClient(
|
||||
const std::string& directoryName) const
|
||||
{
|
||||
auto builder = m_dfsUri;
|
||||
auto builder = m_dfsUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(directoryName));
|
||||
return DataLakeDirectoryClient(
|
||||
builder, m_blobContainerClient.GetBlobClient(directoryName), m_pipeline);
|
||||
@ -301,7 +301,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.Directory = options.Directory;
|
||||
protocolLayerOptions.RecursiveRequired = recursive;
|
||||
return Details::DataLakeRestClient::FileSystem::ListPaths(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::DataLake
|
||||
|
||||
@ -30,7 +30,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
blobOptions.RetryOptions = options.RetryOptions;
|
||||
blobOptions.RetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetBlobUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetBlobUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
return blobOptions;
|
||||
}
|
||||
|
||||
@ -99,8 +99,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& pathUri,
|
||||
std::shared_ptr<StorageSharedKeyCredential> credential,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(pathUri)),
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), credential, GetBlobClientOptions(options))
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(pathUri)),
|
||||
m_blobClient(Details::GetBlobUrlFromUrl(pathUri), credential, GetBlobClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -112,7 +112,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -130,8 +130,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& pathUri,
|
||||
std::shared_ptr<Core::TokenCredential> credential,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(pathUri)),
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), credential, GetBlobClientOptions(options))
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(pathUri)),
|
||||
m_blobClient(Details::GetBlobUrlFromUrl(pathUri), credential, GetBlobClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -143,7 +143,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -161,8 +161,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakePathClient::DataLakePathClient(
|
||||
const std::string& pathUri,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(pathUri)),
|
||||
m_blobClient(Details::GetBlobUriFromUri(pathUri), GetBlobClientOptions(options))
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(pathUri)),
|
||||
m_blobClient(Details::GetBlobUrlFromUrl(pathUri), GetBlobClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -174,7 +174,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StoragePerRetryPolicy>());
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
@ -203,7 +203,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
|
||||
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
return Details::DataLakeRestClient::Path::SetAccessControl(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetDataLakePathPermissionsResult>
|
||||
@ -221,7 +221,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
|
||||
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
return Details::DataLakeRestClient::Path::SetAccessControl(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetDataLakePathHttpHeadersResult>
|
||||
@ -270,7 +270,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.Umask = options.Umask;
|
||||
protocolLayerOptions.Permissions = options.Permissions;
|
||||
auto result = Details::DataLakeRestClient::Path::Create(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::CreateDataLakePathResult ret;
|
||||
ret.ETag = std::move(result->ETag.GetValue());
|
||||
ret.LastModified = std::move(result->LastModified.GetValue());
|
||||
@ -314,7 +314,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
protocolLayerOptions.RecursiveOptional = options.Recursive;
|
||||
auto result = Details::DataLakeRestClient::Path::Delete(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::DeleteDataLakePathResult ret;
|
||||
ret.ContinuationToken = std::move(result->ContinuationToken);
|
||||
ret.Deleted = true;
|
||||
@ -398,7 +398,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
|
||||
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
auto result = Details::DataLakeRestClient::Path::GetProperties(
|
||||
m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_dfsUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Azure::Core::Nullable<std::vector<Models::Acl>> acl;
|
||||
if (result->Acl.HasValue())
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
blobOptions.RetryOptions = options.RetryOptions;
|
||||
blobOptions.RetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetBlobUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetBlobUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
return blobOptions;
|
||||
}
|
||||
|
||||
@ -73,8 +73,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<StorageSharedKeyCredential> credential,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUriFromUri(serviceUri),
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUrlFromUrl(serviceUri),
|
||||
credential,
|
||||
GetBlobServiceClientOptions(options))
|
||||
{
|
||||
@ -88,7 +88,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -105,8 +105,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<Core::TokenCredential> credential,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUriFromUri(serviceUri),
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUrlFromUrl(serviceUri),
|
||||
credential,
|
||||
GetBlobServiceClientOptions(options))
|
||||
{
|
||||
@ -120,7 +120,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -137,8 +137,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeServiceClient::DataLakeServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const DataLakeClientOptions& options)
|
||||
: m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUriFromUri(serviceUri),
|
||||
: m_dfsUrl(Details::GetDfsUrlFromUrl(serviceUri)), m_blobServiceClient(
|
||||
Details::GetBlobUrlFromUrl(serviceUri),
|
||||
GetBlobServiceClientOptions(options))
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -151,7 +151,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
StorageRetryWithSecondaryOptions dfsRetryOptions = options.RetryOptions;
|
||||
dfsRetryOptions.SecondaryHostForRetryReads
|
||||
= Details::GetDfsUriFromUri(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
= Details::GetDfsUrlFromUrl(options.RetryOptions.SecondaryHostForRetryReads);
|
||||
policies.emplace_back(std::make_unique<Storage::Details::StorageRetryPolicy>(dfsRetryOptions));
|
||||
for (const auto& p : options.PerRetryPolicies)
|
||||
{
|
||||
@ -166,7 +166,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
DataLakeFileSystemClient DataLakeServiceClient::GetFileSystemClient(
|
||||
const std::string& fileSystemName) const
|
||||
{
|
||||
auto builder = m_dfsUri;
|
||||
auto builder = m_dfsUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(fileSystemName));
|
||||
return DataLakeFileSystemClient(
|
||||
builder, m_blobServiceClient.GetBlobContainerClient(fileSystemName), m_pipeline);
|
||||
|
||||
@ -12,9 +12,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
|
||||
const static std::string c_DfsEndPointIdentifier = ".dfs.";
|
||||
const static std::string c_BlobEndPointIdentifier = ".blob.";
|
||||
|
||||
std::string GetBlobUriFromUri(const std::string& uri)
|
||||
std::string GetBlobUrlFromUrl(const std::string& url)
|
||||
{
|
||||
std::string result = uri;
|
||||
std::string result = url;
|
||||
auto pos = result.find(c_DfsEndPointIdentifier);
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
@ -23,9 +23,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string GetDfsUriFromUri(const std::string& uri)
|
||||
std::string GetDfsUrlFromUrl(const std::string& url)
|
||||
{
|
||||
std::string result = uri;
|
||||
std::string result = url;
|
||||
auto pos = result.find(c_BlobEndPointIdentifier);
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
|
||||
@ -386,7 +386,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto clientSecretClient = Azure::Storage::Files::DataLake::DataLakeDirectoryClient(
|
||||
Azure::Storage::Files::DataLake::DataLakeDirectoryClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), m_fileSystemName, RandomString(10))
|
||||
.GetUri(),
|
||||
.GetUrl(),
|
||||
credential);
|
||||
|
||||
EXPECT_NO_THROW(clientSecretClient.Create());
|
||||
@ -408,7 +408,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_NO_THROW(directoryClient.Create());
|
||||
|
||||
auto anonymousClient
|
||||
= Azure::Storage::Files::DataLake::DataLakeDirectoryClient(directoryClient.GetUri());
|
||||
= Azure::Storage::Files::DataLake::DataLakeDirectoryClient(directoryClient.GetUrl());
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(30));
|
||||
|
||||
|
||||
@ -582,7 +582,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto clientSecretClient = Azure::Storage::Files::DataLake::DataLakeFileClient(
|
||||
Azure::Storage::Files::DataLake::DataLakeFileClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), m_fileSystemName, RandomString(10))
|
||||
.GetUri(),
|
||||
.GetUrl(),
|
||||
credential);
|
||||
|
||||
EXPECT_NO_THROW(clientSecretClient.Create());
|
||||
@ -608,7 +608,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto anonymousClient = Azure::Storage::Files::DataLake::DataLakeFileClient(
|
||||
Azure::Storage::Files::DataLake::DataLakeFileClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), m_fileSystemName, objectName)
|
||||
.GetUri());
|
||||
.GetUrl());
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(30));
|
||||
|
||||
|
||||
@ -297,26 +297,26 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
std::string pathName = baseName + RandomString();
|
||||
auto pathClient = m_fileSystemClient->GetPathClient(pathName);
|
||||
EXPECT_NO_THROW(pathClient.Create(Files::DataLake::Models::PathResourceType::File));
|
||||
auto pathUrl = pathClient.GetUri();
|
||||
auto pathUrl = pathClient.GetUrl();
|
||||
EXPECT_EQ(
|
||||
pathUrl, m_fileSystemClient->GetUri() + "/" + Storage::Details::UrlEncodePath(pathName));
|
||||
pathUrl, m_fileSystemClient->GetUrl() + "/" + Storage::Details::UrlEncodePath(pathName));
|
||||
}
|
||||
{
|
||||
std::string directoryName = baseName + RandomString();
|
||||
auto directoryClient = m_fileSystemClient->GetDirectoryClient(directoryName);
|
||||
EXPECT_NO_THROW(directoryClient.Create());
|
||||
auto directoryUrl = directoryClient.GetUri();
|
||||
auto directoryUrl = directoryClient.GetUrl();
|
||||
EXPECT_EQ(
|
||||
directoryUrl,
|
||||
m_fileSystemClient->GetUri() + "/" + Storage::Details::UrlEncodePath(directoryName));
|
||||
m_fileSystemClient->GetUrl() + "/" + Storage::Details::UrlEncodePath(directoryName));
|
||||
}
|
||||
{
|
||||
std::string fileName = baseName + RandomString();
|
||||
auto fileClient = m_fileSystemClient->GetFileClient(fileName);
|
||||
EXPECT_NO_THROW(fileClient.Create());
|
||||
auto fileUrl = fileClient.GetUri();
|
||||
auto fileUrl = fileClient.GetUrl();
|
||||
EXPECT_EQ(
|
||||
fileUrl, m_fileSystemClient->GetUri() + "/" + Storage::Details::UrlEncodePath(fileName));
|
||||
fileUrl, m_fileSystemClient->GetUrl() + "/" + Storage::Details::UrlEncodePath(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
@ -340,7 +340,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto clientSecretClient = Azure::Storage::Files::DataLake::DataLakeFileSystemClient(
|
||||
Azure::Storage::Files::DataLake::DataLakeFileSystemClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), LowercaseRandomString(10))
|
||||
.GetUri(),
|
||||
.GetUrl(),
|
||||
credential);
|
||||
|
||||
EXPECT_NO_THROW(clientSecretClient.Create());
|
||||
|
||||
@ -365,7 +365,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto clientSecretClient = Azure::Storage::Files::DataLake::DataLakePathClient(
|
||||
Azure::Storage::Files::DataLake::DataLakePathClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), m_fileSystemName, LowercaseRandomString(10))
|
||||
.GetUri(),
|
||||
.GetUrl(),
|
||||
credential);
|
||||
|
||||
EXPECT_NO_THROW(clientSecretClient.Create(Files::DataLake::Models::PathResourceType::File));
|
||||
@ -387,7 +387,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_NO_THROW(pathClient.Create(Files::DataLake::Models::PathResourceType::File));
|
||||
|
||||
auto anonymousClient
|
||||
= Azure::Storage::Files::DataLake::DataLakePathClient(pathClient.GetUri());
|
||||
= Azure::Storage::Files::DataLake::DataLakePathClient(pathClient.GetUrl());
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(30));
|
||||
|
||||
|
||||
@ -52,33 +52,33 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
directory1Client0.Create();
|
||||
directory2Client0.Create();
|
||||
|
||||
auto serviceUri = Files::DataLake::Details::GetDfsUriFromUri(serviceClient0.GetUri());
|
||||
auto filesystemUri = Files::DataLake::Details::GetDfsUriFromUri(filesystemClient0.GetUri());
|
||||
auto directory1Uri = Files::DataLake::Details::GetDfsUriFromUri(directory1Client0.GetUri());
|
||||
auto directory2Uri = Files::DataLake::Details::GetDfsUriFromUri(directory2Client0.GetUri());
|
||||
auto fileUri = fileClient0.GetUri();
|
||||
auto serviceUrl = Files::DataLake::Details::GetDfsUrlFromUrl(serviceClient0.GetUrl());
|
||||
auto filesystemUrl = Files::DataLake::Details::GetDfsUrlFromUrl(filesystemClient0.GetUrl());
|
||||
auto directory1Url = Files::DataLake::Details::GetDfsUrlFromUrl(directory1Client0.GetUrl());
|
||||
auto directory2Url = Files::DataLake::Details::GetDfsUrlFromUrl(directory2Client0.GetUrl());
|
||||
auto fileUrl = fileClient0.GetUrl();
|
||||
|
||||
auto serviceClient1 = Files::DataLake::DataLakeServiceClient(
|
||||
serviceUri,
|
||||
serviceUrl,
|
||||
std::make_shared<Azure::Identity::ClientSecretCredential>(
|
||||
AadTenantId(), AadClientId(), AadClientSecret()));
|
||||
auto userDelegationKey = serviceClient1.GetUserDelegationKey(sasStartsOn, sasExpiresOn)->Key;
|
||||
|
||||
auto verify_file_read = [&](const std::string& sas) {
|
||||
EXPECT_NO_THROW(fileClient0.Create());
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sas);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sas);
|
||||
auto downloadedContent = fileClient.Read();
|
||||
EXPECT_TRUE(ReadBodyStream(downloadedContent->Body).empty());
|
||||
};
|
||||
|
||||
auto verify_file_write = [&](const std::string& sas) {
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sas);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sas);
|
||||
EXPECT_NO_THROW(fileClient.Create());
|
||||
};
|
||||
|
||||
auto verify_file_delete = [&](const std::string& sas) {
|
||||
fileClient0.Create();
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sas);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sas);
|
||||
EXPECT_NO_THROW(fileClient.Delete());
|
||||
};
|
||||
|
||||
@ -90,12 +90,12 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
};
|
||||
|
||||
auto verify_filesystem_list = [&](const std::string& sas) {
|
||||
auto filesystemClient = Files::DataLake::DataLakeFileSystemClient(filesystemUri + sas);
|
||||
auto filesystemClient = Files::DataLake::DataLakeFileSystemClient(filesystemUrl + sas);
|
||||
EXPECT_NO_THROW(filesystemClient.ListPathsSinglePage(true));
|
||||
};
|
||||
|
||||
auto verify_directory_list = [&](const std::string& sas) {
|
||||
auto filesystemClient = Files::DataLake::DataLakeFileSystemClient(filesystemUri + sas);
|
||||
auto filesystemClient = Files::DataLake::DataLakeFileSystemClient(filesystemUrl + sas);
|
||||
Files::DataLake::ListPathsSinglePageOptions options;
|
||||
options.Directory = directory1Name;
|
||||
EXPECT_NO_THROW(filesystemClient.ListPathsSinglePage(true, options));
|
||||
@ -109,7 +109,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
catch (StorageException&)
|
||||
{
|
||||
}
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sas);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sas);
|
||||
fileClient.Create();
|
||||
};
|
||||
|
||||
@ -125,25 +125,25 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto newFileClient0 = directory2Client0.GetFileClient(newFilename);
|
||||
newFileClient0.Create();
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(
|
||||
Files::DataLake::Details::GetDfsUriFromUri(newFileClient0.GetUri()) + sas);
|
||||
Files::DataLake::Details::GetDfsUrlFromUrl(newFileClient0.GetUrl()) + sas);
|
||||
EXPECT_NO_THROW(fileClient.Rename(directory1Name + "/" + directory2Name + "/" + fileName));
|
||||
};
|
||||
|
||||
auto verify_file_execute = [&](const std::string& sas) {
|
||||
fileClient0.Create();
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sas);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sas);
|
||||
EXPECT_NO_THROW(fileClient0.GetAccessControls());
|
||||
};
|
||||
|
||||
auto verify_file_ownership = [&](const std::string& sas) {
|
||||
fileClient0.Create();
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sas);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sas);
|
||||
EXPECT_NO_THROW(fileClient0.GetAccessControls());
|
||||
};
|
||||
|
||||
auto verify_file_permissions = [&](const std::string& sas) {
|
||||
fileClient0.Create();
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sas);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sas);
|
||||
auto acls = fileClient0.GetAccessControls()->Acls;
|
||||
EXPECT_NO_THROW(fileClient.SetAccessControlList(acls));
|
||||
};
|
||||
@ -422,7 +422,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
builder2.CacheControl = "no-cache";
|
||||
builder2.ContentEncoding = "identify";
|
||||
auto sasToken = builder2.GenerateSasToken(*keyCredential);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUri + sasToken);
|
||||
auto fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sasToken);
|
||||
fileClient0.Create();
|
||||
auto p = fileClient.GetProperties();
|
||||
EXPECT_EQ(p->HttpHeaders.ContentType, headers.ContentType);
|
||||
@ -432,7 +432,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_EQ(p->HttpHeaders.ContentEncoding, headers.ContentEncoding);
|
||||
|
||||
auto sasToken2 = builder2.GenerateSasToken(userDelegationKey, accountName);
|
||||
fileClient = Files::DataLake::DataLakeFileClient(fileUri + sasToken);
|
||||
fileClient = Files::DataLake::DataLakeFileClient(fileUrl + sasToken);
|
||||
p = fileClient.GetProperties();
|
||||
EXPECT_EQ(p->HttpHeaders.ContentType, headers.ContentType);
|
||||
EXPECT_EQ(p->HttpHeaders.ContentLanguage, headers.ContentLanguage);
|
||||
|
||||
@ -152,12 +152,12 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto sasToken = accountSasBuilder.GenerateSasToken(*keyCredential);
|
||||
|
||||
// Create from Anonymous credential.
|
||||
auto datalakeServiceUri
|
||||
auto datalakeServiceUrl
|
||||
= Azure::Storage::Files::DataLake::DataLakeServiceClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString())
|
||||
.GetUri();
|
||||
.GetUrl();
|
||||
auto datalakeServiceClient
|
||||
= Azure::Storage::Files::DataLake::DataLakeServiceClient(datalakeServiceUri + sasToken);
|
||||
= Azure::Storage::Files::DataLake::DataLakeServiceClient(datalakeServiceUrl + sasToken);
|
||||
EXPECT_NO_THROW(datalakeServiceClient.ListFileSystemsSinglePage());
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
### Breaking Changes
|
||||
|
||||
- Removed `GetDirectoryClient` and `GetFileClient` from `ShareClient`. `ShareDirectoryClient` and `ShareFileClient` now initializes with the name of the resource, not path, to indicate that no path parsing is done for the API
|
||||
- Renamed `GetUri` to `GetUrl`.
|
||||
|
||||
## 12.0.0-beta.6 (2020-01-14)
|
||||
|
||||
|
||||
@ -57,11 +57,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the share's primary uri endpoint.
|
||||
* @brief Gets the share's primary url endpoint.
|
||||
*
|
||||
* @return The share's primary uri endpoint.
|
||||
* @return The share's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_shareUri.GetAbsoluteUrl(); }
|
||||
std::string GetUrl() const { return m_shareUrl.GetAbsoluteUrl(); }
|
||||
|
||||
/**
|
||||
* @brief Initializes a new instance of the ShareClient class with an identical uri
|
||||
@ -220,13 +220,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
= ListFilesAndDirectoriesSinglePageOptions()) const;
|
||||
|
||||
private:
|
||||
Azure::Core::Http::Url m_shareUri;
|
||||
Azure::Core::Http::Url m_shareUrl;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
|
||||
explicit ShareClient(
|
||||
Azure::Core::Http::Url shareUri,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: m_shareUri(std::move(shareUri)), m_pipeline(std::move(pipeline))
|
||||
: m_shareUrl(std::move(shareUri)), m_pipeline(std::move(pipeline))
|
||||
{
|
||||
}
|
||||
friend class ShareServiceClient;
|
||||
|
||||
@ -58,11 +58,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the directory's primary uri endpoint.
|
||||
* @brief Gets the directory's primary url endpoint.
|
||||
*
|
||||
* @return The directory's primary uri endpoint.
|
||||
* @return The directory's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_shareDirectoryUri.GetAbsoluteUrl(); }
|
||||
std::string GetUrl() const { return m_shareDirectoryUrl.GetAbsoluteUrl(); }
|
||||
|
||||
/**
|
||||
* @brief Create a ShareDirectoryClient that's a sub directory of the current
|
||||
@ -209,13 +209,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
= ForceCloseAllShareDirectoryHandlesOptions()) const;
|
||||
|
||||
private:
|
||||
Azure::Core::Http::Url m_shareDirectoryUri;
|
||||
Azure::Core::Http::Url m_shareDirectoryUrl;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
|
||||
explicit ShareDirectoryClient(
|
||||
Azure::Core::Http::Url shareDirectoryUri,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: m_shareDirectoryUri(std::move(shareDirectoryUri)), m_pipeline(std::move(pipeline))
|
||||
: m_shareDirectoryUrl(std::move(shareDirectoryUri)), m_pipeline(std::move(pipeline))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -57,11 +57,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const ShareClientOptions& options = ShareClientOptions());
|
||||
|
||||
/**
|
||||
* @brief Gets the file's primary uri endpoint.
|
||||
* @brief Gets the file's primary url endpoint.
|
||||
*
|
||||
* @return The file's primary uri endpoint.
|
||||
* @return The file's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_shareFileUri.GetAbsoluteUrl(); }
|
||||
std::string GetUrl() const { return m_shareFileUrl.GetAbsoluteUrl(); }
|
||||
|
||||
/**
|
||||
* @brief Initializes a new instance of the ShareFileClient class with an identical uri
|
||||
@ -344,13 +344,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const BreakShareFileLeaseOptions& options = BreakShareFileLeaseOptions()) const;
|
||||
|
||||
private:
|
||||
Azure::Core::Http::Url m_shareFileUri;
|
||||
Azure::Core::Http::Url m_shareFileUrl;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
|
||||
explicit ShareFileClient(
|
||||
Azure::Core::Http::Url shareFileUri,
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> pipeline)
|
||||
: m_shareFileUri(std::move(shareFileUri)), m_pipeline(std::move(pipeline))
|
||||
: m_shareFileUrl(std::move(shareFileUri)), m_pipeline(std::move(pipeline))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -60,11 +60,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareClient GetShareClient(const std::string& shareName) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the file share service's primary uri endpoint.
|
||||
* @brief Gets the file share service's primary url endpoint.
|
||||
*
|
||||
* @return The file share service's primary uri endpoint.
|
||||
* @return The file share service's primary url endpoint.
|
||||
*/
|
||||
std::string GetUri() const { return m_serviceUri.GetAbsoluteUrl(); }
|
||||
std::string GetUrl() const { return m_serviceUrl.GetAbsoluteUrl(); }
|
||||
|
||||
/**
|
||||
* @brief List the shares from the service.
|
||||
@ -97,7 +97,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const GetServicePropertiesOptions& options = GetServicePropertiesOptions()) const;
|
||||
|
||||
private:
|
||||
Azure::Core::Http::Url m_serviceUri;
|
||||
Azure::Core::Http::Url m_serviceUrl;
|
||||
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;
|
||||
};
|
||||
}}}} // namespace Azure::Storage::Files::Shares
|
||||
|
||||
@ -41,7 +41,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& shareUri,
|
||||
std::shared_ptr<StorageSharedKeyCredential> credential,
|
||||
const ShareClientOptions& options)
|
||||
: m_shareUri(shareUri)
|
||||
: m_shareUrl(shareUri)
|
||||
{
|
||||
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -66,7 +66,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
|
||||
ShareClient::ShareClient(const std::string& shareUri, const ShareClientOptions& options)
|
||||
: m_shareUri(shareUri)
|
||||
: m_shareUrl(shareUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -90,7 +90,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
ShareDirectoryClient ShareClient::GetRootDirectoryClient() const
|
||||
{
|
||||
return ShareDirectoryClient(m_shareUri, m_pipeline);
|
||||
return ShareDirectoryClient(m_shareUrl, m_pipeline);
|
||||
}
|
||||
|
||||
ShareClient ShareClient::WithSnapshot(const std::string& snapshot) const
|
||||
@ -98,11 +98,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareClient newClient(*this);
|
||||
if (snapshot.empty())
|
||||
{
|
||||
newClient.m_shareUri.RemoveQueryParameter(Details::c_ShareSnapshotQueryParameter);
|
||||
newClient.m_shareUrl.RemoveQueryParameter(Details::c_ShareSnapshotQueryParameter);
|
||||
}
|
||||
else
|
||||
{
|
||||
newClient.m_shareUri.AppendQueryParameter(
|
||||
newClient.m_shareUrl.AppendQueryParameter(
|
||||
Details::c_ShareSnapshotQueryParameter,
|
||||
Storage::Details::UrlEncodeQueryParameter(snapshot));
|
||||
}
|
||||
@ -116,7 +116,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
protocolLayerOptions.ShareQuota = options.ShareQuotaInGiB;
|
||||
auto result = Details::ShareRestClient::Share::Create(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::CreateShareResult ret;
|
||||
ret.Created = true;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
@ -154,7 +154,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.XMsDeleteSnapshots = Models::DeleteSnapshotsOptionType::Include;
|
||||
}
|
||||
auto result = Details::ShareRestClient::Share::Delete(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::DeleteShareResult ret;
|
||||
ret.Deleted = true;
|
||||
return Azure::Core::Response<Models::DeleteShareResult>(
|
||||
@ -187,7 +187,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::CreateSnapshotOptions();
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
return Details::ShareRestClient::Share::CreateSnapshot(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::GetSharePropertiesResult> ShareClient::GetProperties(
|
||||
@ -195,7 +195,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::GetPropertiesOptions();
|
||||
return Details::ShareRestClient::Share::GetProperties(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetShareQuotaResult> ShareClient::SetQuota(
|
||||
@ -205,7 +205,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::SetQuotaOptions();
|
||||
protocolLayerOptions.ShareQuota = quotaInGiB;
|
||||
return Details::ShareRestClient::Share::SetQuota(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetShareMetadataResult> ShareClient::SetMetadata(
|
||||
@ -215,7 +215,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::SetMetadataOptions();
|
||||
protocolLayerOptions.Metadata = metadata;
|
||||
return Details::ShareRestClient::Share::SetMetadata(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::GetShareAccessPolicyResult> ShareClient::GetAccessPolicy(
|
||||
@ -223,7 +223,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::GetAccessPolicyOptions();
|
||||
return Details::ShareRestClient::Share::GetAccessPolicy(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetShareAccessPolicyResult> ShareClient::SetAccessPolicy(
|
||||
@ -233,7 +233,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::SetAccessPolicyOptions();
|
||||
protocolLayerOptions.ShareAcl = accessPolicy;
|
||||
return Details::ShareRestClient::Share::SetAccessPolicy(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::GetShareStatisticsResult> ShareClient::GetStatistics(
|
||||
@ -241,7 +241,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::GetStatisticsOptions();
|
||||
return Details::ShareRestClient::Share::GetStatistics(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::CreateSharePermissionResult> ShareClient::CreatePermission(
|
||||
@ -251,7 +251,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::CreatePermissionOptions();
|
||||
protocolLayerOptions.Permission.Permission = permission;
|
||||
return Details::ShareRestClient::Share::CreatePermission(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::GetSharePermissionResult> ShareClient::GetPermission(
|
||||
@ -261,7 +261,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::GetPermissionOptions();
|
||||
protocolLayerOptions.FilePermissionKeyRequired = permissionKey;
|
||||
return Details::ShareRestClient::Share::GetPermission(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ListFilesAndDirectoriesSinglePageResult>
|
||||
@ -274,7 +274,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
|
||||
protocolLayerOptions.MaxResults = options.PageSizeHint;
|
||||
auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePage(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::ListFilesAndDirectoriesSinglePageResult ret;
|
||||
ret.ServiceEndpoint = std::move(result->ServiceEndpoint);
|
||||
ret.ShareName = std::move(result->ShareName);
|
||||
|
||||
@ -43,7 +43,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& shareDirectoryUri,
|
||||
std::shared_ptr<StorageSharedKeyCredential> credential,
|
||||
const ShareClientOptions& options)
|
||||
: m_shareDirectoryUri(shareDirectoryUri)
|
||||
: m_shareDirectoryUrl(shareDirectoryUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -69,7 +69,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareDirectoryClient::ShareDirectoryClient(
|
||||
const std::string& shareDirectoryUri,
|
||||
const ShareClientOptions& options)
|
||||
: m_shareDirectoryUri(shareDirectoryUri)
|
||||
: m_shareDirectoryUrl(shareDirectoryUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -94,14 +94,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareDirectoryClient ShareDirectoryClient::GetSubdirectoryClient(
|
||||
const std::string& subdirectoryName) const
|
||||
{
|
||||
auto builder = m_shareDirectoryUri;
|
||||
auto builder = m_shareDirectoryUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(subdirectoryName));
|
||||
return ShareDirectoryClient(builder, m_pipeline);
|
||||
}
|
||||
|
||||
ShareFileClient ShareDirectoryClient::GetFileClient(const std::string& fileName) const
|
||||
{
|
||||
auto builder = m_shareDirectoryUri;
|
||||
auto builder = m_shareDirectoryUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(fileName));
|
||||
return ShareFileClient(builder, m_pipeline);
|
||||
}
|
||||
@ -112,11 +112,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareDirectoryClient newClient(*this);
|
||||
if (shareSnapshot.empty())
|
||||
{
|
||||
newClient.m_shareDirectoryUri.RemoveQueryParameter(Details::c_ShareSnapshotQueryParameter);
|
||||
newClient.m_shareDirectoryUrl.RemoveQueryParameter(Details::c_ShareSnapshotQueryParameter);
|
||||
}
|
||||
else
|
||||
{
|
||||
newClient.m_shareDirectoryUri.AppendQueryParameter(
|
||||
newClient.m_shareDirectoryUrl.AppendQueryParameter(
|
||||
Details::c_ShareSnapshotQueryParameter,
|
||||
Storage::Details::UrlEncodeQueryParameter(shareSnapshot));
|
||||
}
|
||||
@ -168,7 +168,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.FilePermission = std::string(c_FileInheritPermission);
|
||||
}
|
||||
auto result = Details::ShareRestClient::Directory::Create(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::CreateShareDirectoryResult ret;
|
||||
ret.Created = true;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
@ -212,7 +212,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::DeleteOptions();
|
||||
auto result = Details::ShareRestClient::Directory::Delete(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::DeleteShareDirectoryResult ret;
|
||||
ret.Deleted = true;
|
||||
return Azure::Core::Response<Models::DeleteShareDirectoryResult>(
|
||||
@ -245,7 +245,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::GetPropertiesOptions();
|
||||
return Details::ShareRestClient::Directory::GetProperties(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetShareDirectoryPropertiesResult>
|
||||
@ -287,7 +287,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.FilePermission = std::string(c_FileInheritPermission);
|
||||
}
|
||||
return Details::ShareRestClient::Directory::SetProperties(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetShareDirectoryMetadataResult> ShareDirectoryClient::SetMetadata(
|
||||
@ -297,7 +297,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::SetMetadataOptions();
|
||||
protocolLayerOptions.Metadata = std::move(metadata);
|
||||
return Details::ShareRestClient::Directory::SetMetadata(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ListFilesAndDirectoriesSinglePageResult>
|
||||
@ -310,7 +310,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
|
||||
protocolLayerOptions.MaxResults = options.PageSizeHint;
|
||||
auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePage(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::ListFilesAndDirectoriesSinglePageResult ret;
|
||||
ret.ServiceEndpoint = std::move(result->ServiceEndpoint);
|
||||
ret.ShareName = std::move(result->ShareName);
|
||||
@ -336,7 +336,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.MaxResults = options.PageSizeHint;
|
||||
protocolLayerOptions.Recursive = options.Recursive;
|
||||
auto result = Details::ShareRestClient::Directory::ListHandles(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::ListShareDirectoryHandlesSinglePageResult ret;
|
||||
ret.ContinuationToken = std::move(result->ContinuationToken);
|
||||
ret.Handles = std::move(result->HandleList);
|
||||
@ -353,7 +353,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::ForceCloseHandlesOptions();
|
||||
protocolLayerOptions.HandleId = handleId;
|
||||
auto result = Details::ShareRestClient::File::ForceCloseHandles(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
return Azure::Core::Response<Models::ForceCloseShareDirectoryHandleResult>(
|
||||
Models::ForceCloseShareDirectoryHandleResult(), result.ExtractRawResponse());
|
||||
}
|
||||
@ -367,7 +367,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
|
||||
protocolLayerOptions.Recursive = options.Recursive;
|
||||
return Details::ShareRestClient::Directory::ForceCloseHandles(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareDirectoryUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::Shares
|
||||
|
||||
@ -46,7 +46,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& shareFileUri,
|
||||
std::shared_ptr<StorageSharedKeyCredential> credential,
|
||||
const ShareClientOptions& options)
|
||||
: m_shareFileUri(shareFileUri)
|
||||
: m_shareFileUrl(shareFileUri)
|
||||
{
|
||||
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
@ -73,7 +73,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareFileClient::ShareFileClient(
|
||||
const std::string& shareFileUri,
|
||||
const ShareClientOptions& options)
|
||||
: m_shareFileUri(shareFileUri)
|
||||
: m_shareFileUrl(shareFileUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -99,11 +99,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareFileClient newClient(*this);
|
||||
if (shareSnapshot.empty())
|
||||
{
|
||||
newClient.m_shareFileUri.RemoveQueryParameter(Details::c_ShareSnapshotQueryParameter);
|
||||
newClient.m_shareFileUrl.RemoveQueryParameter(Details::c_ShareSnapshotQueryParameter);
|
||||
}
|
||||
else
|
||||
{
|
||||
newClient.m_shareFileUri.AppendQueryParameter(
|
||||
newClient.m_shareFileUrl.AppendQueryParameter(
|
||||
Details::c_ShareSnapshotQueryParameter,
|
||||
Storage::Details::UrlEncodeQueryParameter(shareSnapshot));
|
||||
}
|
||||
@ -186,7 +186,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
auto result = Details::ShareRestClient::File::Create(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::CreateShareFileResult ret;
|
||||
ret.Created = true;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
@ -210,7 +210,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::DeleteOptions();
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
auto result = Details::ShareRestClient::File::Delete(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::DeleteShareFileResult ret;
|
||||
ret.Deleted = true;
|
||||
return Azure::Core::Response<Models::DeleteShareFileResult>(
|
||||
@ -261,7 +261,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
|
||||
auto downloadResponse = Details::ShareRestClient::File::Download(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
|
||||
{
|
||||
// In case network failure during reading the body
|
||||
@ -357,7 +357,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.FileCopySetArchiveAttribute = options.SetArchiveAttribute;
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::ShareRestClient::File::StartCopy(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::AbortCopyShareFileResult> ShareFileClient::AbortCopy(
|
||||
@ -368,7 +368,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.CopyId = std::move(copyId);
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::ShareRestClient::File::AbortCopy(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::GetShareFilePropertiesResult> ShareFileClient::GetProperties(
|
||||
@ -377,7 +377,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::GetPropertiesOptions();
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::ShareRestClient::File::GetProperties(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetShareFilePropertiesResult> ShareFileClient::SetProperties(
|
||||
@ -448,7 +448,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
|
||||
return Details::ShareRestClient::File::SetHttpHeaders(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetShareFileMetadataResult> ShareFileClient::SetMetadata(
|
||||
@ -459,7 +459,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.Metadata = std::move(metadata);
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::ShareRestClient::File::SetMetadata(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::UploadShareFileRangeResult> ShareFileClient::UploadRange(
|
||||
@ -480,7 +480,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.ContentMd5 = options.TransactionalContentHash;
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::ShareRestClient::File::UploadRange(
|
||||
m_shareFileUri, *content, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *content, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ClearShareFileRangeResult> ShareFileClient::ClearRange(
|
||||
@ -496,7 +496,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::ShareRestClient::File::UploadRange(
|
||||
m_shareFileUri,
|
||||
m_shareFileUrl,
|
||||
*Azure::Core::Http::NullBodyStream::GetNullBodyStream(),
|
||||
*m_pipeline,
|
||||
options.Context,
|
||||
@ -526,7 +526,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.PrevShareSnapshot = options.PrevShareSnapshot;
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
return Details::ShareRestClient::File::GetRangeList(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ListShareFileHandlesSinglePageResult>
|
||||
@ -536,7 +536,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
|
||||
protocolLayerOptions.MaxResults = options.PageSizeHint;
|
||||
auto result = Details::ShareRestClient::File::ListHandles(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::ListShareFileHandlesSinglePageResult ret;
|
||||
ret.ContinuationToken = std::move(result->ContinuationToken);
|
||||
ret.Handles = std::move(result->HandleList);
|
||||
@ -552,7 +552,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::ForceCloseHandlesOptions();
|
||||
protocolLayerOptions.HandleId = handleId;
|
||||
auto result = Details::ShareRestClient::File::ForceCloseHandles(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
return Azure::Core::Response<Models::ForceCloseShareFileHandleResult>(
|
||||
Models::ForceCloseShareFileHandleResult(), result.ExtractRawResponse());
|
||||
}
|
||||
@ -564,7 +564,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.HandleId = c_FileAllHandles;
|
||||
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
|
||||
return Details::ShareRestClient::File::ForceCloseHandles(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::AcquireShareFileLeaseResult> ShareFileClient::AcquireLease(
|
||||
@ -575,7 +575,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.ProposedLeaseIdOptional = proposedLeaseId;
|
||||
protocolLayerOptions.LeaseDuration = -1;
|
||||
return Details::ShareRestClient::File::AcquireLease(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ChangeShareFileLeaseResult> ShareFileClient::ChangeLease(
|
||||
@ -587,7 +587,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.LeaseIdRequired = leaseId;
|
||||
protocolLayerOptions.ProposedLeaseIdOptional = proposedLeaseId;
|
||||
return Details::ShareRestClient::File::ChangeLease(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::ReleaseShareFileLeaseResult> ShareFileClient::ReleaseLease(
|
||||
@ -597,7 +597,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
Details::ShareRestClient::File::ReleaseLeaseOptions protocolLayerOptions;
|
||||
protocolLayerOptions.LeaseIdRequired = leaseId;
|
||||
return Details::ShareRestClient::File::ReleaseLease(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::BreakShareFileLeaseResult> ShareFileClient::BreakLease(
|
||||
@ -605,7 +605,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
{
|
||||
Details::ShareRestClient::File::BreakLeaseOptions protocolLayerOptions;
|
||||
return Details::ShareRestClient::File::BreakLease(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::DownloadShareFileToResult> ShareFileClient::DownloadTo(
|
||||
@ -941,7 +941,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
auto createResult = Details::ShareRestClient::File::Create(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
|
||||
int64_t chunkSize = options.ChunkSize.HasValue() ? options.ChunkSize.GetValue()
|
||||
: Details::c_FileUploadDefaultChunkSize;
|
||||
@ -1042,7 +1042,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
auto createResult = Details::ShareRestClient::File::Create(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_shareFileUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
|
||||
int64_t chunkSize = options.ChunkSize.HasValue() ? options.ChunkSize.GetValue()
|
||||
: Details::c_FileUploadDefaultChunkSize;
|
||||
|
||||
@ -38,7 +38,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
const std::string& serviceUri,
|
||||
std::shared_ptr<StorageSharedKeyCredential> credential,
|
||||
const ShareClientOptions& options)
|
||||
: m_serviceUri(serviceUri)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -64,7 +64,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ShareServiceClient::ShareServiceClient(
|
||||
const std::string& serviceUri,
|
||||
const ShareClientOptions& options)
|
||||
: m_serviceUri(serviceUri)
|
||||
: m_serviceUrl(serviceUri)
|
||||
{
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
|
||||
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
|
||||
@ -87,7 +87,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
ShareClient ShareServiceClient::GetShareClient(const std::string& shareName) const
|
||||
{
|
||||
auto builder = m_serviceUri;
|
||||
auto builder = m_serviceUrl;
|
||||
builder.AppendPath(Storage::Details::UrlEncodePath(shareName));
|
||||
return ShareClient(builder, m_pipeline);
|
||||
}
|
||||
@ -101,7 +101,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.MaxResults = options.PageSizeHint;
|
||||
protocolLayerOptions.Prefix = options.Prefix;
|
||||
return Details::ShareRestClient::Service::ListSharesSinglePage(
|
||||
m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_serviceUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::SetServicePropertiesResult> ShareServiceClient::SetProperties(
|
||||
@ -111,7 +111,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Service::SetPropertiesOptions();
|
||||
protocolLayerOptions.ServiceProperties = std::move(properties);
|
||||
return Details::ShareRestClient::Service::SetProperties(
|
||||
m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_serviceUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<Models::GetServicePropertiesResult> ShareServiceClient::GetProperties(
|
||||
@ -119,7 +119,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Service::GetPropertiesOptions();
|
||||
auto result = Details::ShareRestClient::Service::GetProperties(
|
||||
m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
m_serviceUrl, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
Models::StorageServiceProperties ret;
|
||||
ret.Cors = std::move(result->Cors);
|
||||
ret.HourMetrics = std::move(result->HourMetrics);
|
||||
|
||||
@ -348,17 +348,17 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto directoryClient
|
||||
= m_shareClient->GetRootDirectoryClient().GetSubdirectoryClient(directoryName);
|
||||
EXPECT_NO_THROW(directoryClient.Create());
|
||||
auto directoryUrl = directoryClient.GetUri();
|
||||
auto directoryUrl = directoryClient.GetUrl();
|
||||
EXPECT_EQ(
|
||||
directoryUrl,
|
||||
m_shareClient->GetUri() + "/" + Storage::Details::UrlEncodePath(directoryName));
|
||||
m_shareClient->GetUrl() + "/" + Storage::Details::UrlEncodePath(directoryName));
|
||||
}
|
||||
{
|
||||
std::string fileName = baseName + RandomString();
|
||||
auto fileClient = m_shareClient->GetRootDirectoryClient().GetFileClient(fileName);
|
||||
EXPECT_NO_THROW(fileClient.Create(1024));
|
||||
auto fileUrl = fileClient.GetUri();
|
||||
EXPECT_EQ(fileUrl, m_shareClient->GetUri() + "/" + Storage::Details::UrlEncodePath(fileName));
|
||||
auto fileUrl = fileClient.GetUrl();
|
||||
EXPECT_EQ(fileUrl, m_shareClient->GetUrl() + "/" + Storage::Details::UrlEncodePath(fileName));
|
||||
}
|
||||
}
|
||||
}}} // namespace Azure::Storage::Test
|
||||
|
||||
@ -639,7 +639,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto destFileClient
|
||||
= m_shareClient->GetRootDirectoryClient().GetFileClient(LowercaseRandomString(10));
|
||||
Files::Shares::Models::StartCopyShareFileResult result;
|
||||
EXPECT_NO_THROW(result = destFileClient.StartCopy(fileClient.GetUri()).ExtractValue());
|
||||
EXPECT_NO_THROW(result = destFileClient.StartCopy(fileClient.GetUrl()).ExtractValue());
|
||||
EXPECT_EQ(Files::Shares::Models::CopyStatusType::Success, result.CopyStatus);
|
||||
EXPECT_FALSE(result.CopyId.empty());
|
||||
}
|
||||
@ -654,7 +654,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
= m_shareClient->GetRootDirectoryClient().GetFileClient(LowercaseRandomString(10));
|
||||
Files::Shares::StartCopyShareFileOptions copyOptions;
|
||||
copyOptions.PermissionCopyMode = Files::Shares::Models::PermissionCopyModeType::Override;
|
||||
EXPECT_THROW(destFileClient.StartCopy(fileClient.GetUri(), copyOptions), std::runtime_error);
|
||||
EXPECT_THROW(destFileClient.StartCopy(fileClient.GetUrl(), copyOptions), std::runtime_error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,13 +36,13 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto shareClient0 = fileServiceClient0.GetShareClient(m_shareName);
|
||||
auto fileClient0 = shareClient0.GetRootDirectoryClient().GetFileClient(fileName);
|
||||
|
||||
std::string shareUri = shareClient0.GetUri();
|
||||
std::string fileUri = fileClient0.GetUri();
|
||||
std::string shareUrl = shareClient0.GetUrl();
|
||||
std::string fileUrl = fileClient0.GetUrl();
|
||||
|
||||
auto verifyFileRead = [&](const std::string& sas) {
|
||||
int64_t fileSize = 512;
|
||||
fileClient0.Create(fileSize);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUri + sas);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUrl + sas);
|
||||
auto downloadedContent = fileClient.Download();
|
||||
EXPECT_EQ(
|
||||
ReadBodyStream(downloadedContent->BodyStream).size(), static_cast<std::size_t>(fileSize));
|
||||
@ -50,14 +50,14 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
auto verifyFileCreate = [&](const std::string& sas) {
|
||||
int64_t fileSize = 512;
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUri + sas);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUrl + sas);
|
||||
EXPECT_NO_THROW(fileClient.Create(fileSize));
|
||||
};
|
||||
|
||||
auto verifyFileWrite = [&](const std::string& sas) {
|
||||
int64_t fileSize = 512;
|
||||
fileClient0.Create(fileSize);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUri + sas);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUrl + sas);
|
||||
std::string fileContent = "a";
|
||||
EXPECT_NO_THROW(fileClient.UploadFrom(
|
||||
reinterpret_cast<const uint8_t*>(fileContent.data()), fileContent.size()));
|
||||
@ -66,12 +66,12 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto verifyFileDelete = [&](const std::string& sas) {
|
||||
int64_t fileSize = 512;
|
||||
fileClient0.Create(fileSize);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUri + sas);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUrl + sas);
|
||||
EXPECT_NO_THROW(fileClient.Delete());
|
||||
};
|
||||
|
||||
auto verifyFileList = [&](const std::string& sas) {
|
||||
auto shareClient = Files::Shares::ShareClient(shareUri + sas);
|
||||
auto shareClient = Files::Shares::ShareClient(shareUrl + sas);
|
||||
EXPECT_NO_THROW(shareClient.ListFilesAndDirectoriesSinglePage());
|
||||
};
|
||||
|
||||
@ -205,7 +205,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
builder2.CacheControl = "no-cache";
|
||||
builder2.ContentEncoding = "identify";
|
||||
auto sasToken = builder2.GenerateSasToken(*keyCredential);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUri + sasToken);
|
||||
auto fileClient = Files::Shares::ShareFileClient(fileUrl + sasToken);
|
||||
fileClient0.Create(0);
|
||||
auto p = fileClient.GetProperties();
|
||||
EXPECT_EQ(p->HttpHeaders.ContentType, headers.ContentType);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user