azure-storage-files-shares
Public Member Functions | Static Public Member Functions | Friends | List of all members
Azure::Storage::Files::Shares::ShareFileClient Class Referencefinal

Public Member Functions

 ShareFileClient (const std::string &shareFileUrl, std::shared_ptr< StorageSharedKeyCredential > credential, const ShareClientOptions &options=ShareClientOptions())
 Initialize a new instance of ShareFileClient using shared key authentication. More...
 
 ShareFileClient (const std::string &shareFileUrl, const ShareClientOptions &options=ShareClientOptions())
 Initialize a new instance of ShareFileClient using anonymous access or shared access signature. More...
 
std::string GetUrl () const
 Gets the file's primary URL endpoint. More...
 
ShareFileClient WithShareSnapshot (const std::string &shareSnapshot) const
 Initializes a new instance of the ShareFileClient class with an identical URL source but the specified share snapshot timestamp. More...
 
Azure::Response< Models::CreateFileResultCreate (int64_t fileSize, const CreateFileOptions &options=CreateFileOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates the file. More...
 
Azure::Response< Models::DeleteFileResultDelete (const DeleteFileOptions &options=DeleteFileOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Deletes the file. More...
 
Azure::Response< Models::DeleteFileResultDeleteIfExists (const DeleteFileOptions &options=DeleteFileOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Deletes the file if it exists. More...
 
Azure::Response< Models::DownloadFileResultDownload (const DownloadFileOptions &options=DownloadFileOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Open a stream for the file's content, or a range of the file's content that can be used to download the server end data. More...
 
Azure::Response< Models::DownloadFileToResultDownloadTo (uint8_t *buffer, size_t bufferSize, const DownloadFileToOptions &options=DownloadFileToOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Downloads a file or a file range from the service to a memory buffer using parallel requests. More...
 
Azure::Response< Models::DownloadFileToResultDownloadTo (const std::string &fileName, const DownloadFileToOptions &options=DownloadFileToOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Downloads a file or a file range from the service to a memory buffer using parallel requests. More...
 
Azure::Response< Models::UploadFileFromResultUploadFrom (const uint8_t *buffer, size_t bufferSize, const UploadFileFromOptions &options=UploadFileFromOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates a new file, or updates the content of an existing file. Updating an existing file overwrites any existing metadata on the file. More...
 
Azure::Response< Models::UploadFileFromResultUploadFrom (const std::string &fileName, const UploadFileFromOptions &options=UploadFileFromOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Creates a new file, or updates the content of an existing file. Updating an existing file overwrites any existing metadata on the file. More...
 
StartFileCopyOperation StartCopy (std::string copySource, const StartFileCopyOptions &options=StartFileCopyOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Starts copy the file specified from source URI to the file this client points to. More...
 
Azure::Response< Models::AbortFileCopyResultAbortCopy (std::string copyId, const AbortFileCopyOptions &options=AbortFileCopyOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Aborts copying the file specified with the copy ID. More...
 
Azure::Response< Models::FilePropertiesGetProperties (const GetFilePropertiesOptions &options=GetFilePropertiesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Gets the properties of a file. More...
 
Azure::Response< Models::SetFilePropertiesResultSetProperties (const Models::FileHttpHeaders &httpHeaders, const Models::FileSmbProperties &smbProperties, const SetFilePropertiesOptions &options=SetFilePropertiesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Sets the properties of the file, or resize a file specifying NewSize in options. More...
 
Azure::Response< Models::SetFileMetadataResultSetMetadata (Storage::Metadata metadata, const SetFileMetadataOptions &options=SetFileMetadataOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Sets the metadata of the file. More...
 
Azure::Response< Models::UploadFileRangeResultUploadRange (int64_t offset, Azure::Core::IO::BodyStream &content, const UploadFileRangeOptions &options=UploadFileRangeOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Uploads some data to a range of the file. More...
 
Azure::Response< Models::ClearFileRangeResultClearRange (int64_t offset, int64_t length, const ClearFileRangeOptions &options=ClearFileRangeOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Clears some range of data within the file. More...
 
Azure::Response< Models::GetFileRangeListResultGetRangeList (const GetFileRangeListOptions &options=GetFileRangeListOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Gets the list of valid range from the file within specified range. More...
 
Azure::Response< Models::GetFileRangeListResultGetRangeListDiff (std::string previousShareSnapshot, const GetFileRangeListOptions &options=GetFileRangeListOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Gets the list of valid range from the file within specified range that have changed since previousShareSnapshot was taken. More...
 
ListFileHandlesPagedResponse ListHandles (const ListFileHandlesOptions &options=ListFileHandlesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Returns a sequence of the open handles on a directory or a file. Enumerating the handles may make multiple requests to the service while fetching all the values. More...
 
Azure::Response< Models::ForceCloseFileHandleResultForceCloseHandle (const std::string &handleId, const ForceCloseFileHandleOptions &options=ForceCloseFileHandleOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Closes a handle opened on a file at the service. More...
 
ForceCloseAllFileHandlesPagedResponse ForceCloseAllHandles (const ForceCloseAllFileHandlesOptions &options=ForceCloseAllFileHandlesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Closes all handles opened on a file at the service. More...
 
Azure::Response< Models::UploadFileRangeFromUriResultUploadRangeFromUri (int64_t destinationOffset, const std::string &sourceUri, const Azure::Core::Http::HttpRange &sourceRange, const UploadFileRangeFromUriOptions &options=UploadFileRangeFromUriOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
 Upload a range from the source URI to this file's specific range. More...
 

Static Public Member Functions

static ShareFileClient CreateFromConnectionString (const std::string &connectionString, const std::string &shareName, const std::string &fileName, const ShareClientOptions &options=ShareClientOptions())
 Create A ShareFileClient from connection string to manage a File Share File resource. More...
 

Friends

class ShareClient
 
class ShareDirectoryClient
 
class ShareLeaseClient
 

Constructor & Destructor Documentation

◆ ShareFileClient() [1/2]

Azure::Storage::Files::Shares::ShareFileClient::ShareFileClient ( const std::string &  shareFileUrl,
std::shared_ptr< StorageSharedKeyCredential >  credential,
const ShareClientOptions options = ShareClientOptions() 
)
explicit
Parameters
shareFileUrlThe URL of the file this client's request targets.
credentialThe shared key credential used to initialize the client.
optionsOptional parameters used to initialize the client.

◆ ShareFileClient() [2/2]

Azure::Storage::Files::Shares::ShareFileClient::ShareFileClient ( const std::string &  shareFileUrl,
const ShareClientOptions options = ShareClientOptions() 
)
explicit
Parameters
shareFileUrlThe URL of the file this client's request targets.
optionsOptional parameters used to initialize the client.

Member Function Documentation

◆ AbortCopy()

Azure::Response< Models::AbortFileCopyResult > Azure::Storage::Files::Shares::ShareFileClient::AbortCopy ( std::string  copyId,
const AbortFileCopyOptions options = AbortFileCopyOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
copyIdThe copy identifier provided in the StartCopyShareFileResult of the original StartCopy operation.
optionsOptional parameters to abort copying the content of this file.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::AbortFileCopyResult> containing the abort copy related information, current empty but preserved for future usage.

◆ ClearRange()

Azure::Response< Models::ClearFileRangeResult > Azure::Storage::Files::Shares::ShareFileClient::ClearRange ( int64_t  offset,
int64_t  length,
const ClearFileRangeOptions options = ClearFileRangeOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
offsetSpecifies the starting offset for the content to be cleared within the file.
lengthSpecifies the length for the content to be cleared within the file.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::ClearFileRangeResult> containing the information of the cleared range returned from the server.

◆ Create()

Azure::Response< Models::CreateFileResult > Azure::Storage::Files::Shares::ShareFileClient::Create ( int64_t  fileSize,
const CreateFileOptions options = CreateFileOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
fileSizeSize of the file in bytes.
optionsOptional parameters to create this file.
contextContext for cancelling long running operations.
Returns
Azure::Response<CreateFileResult> containing the information returned when creating the file.

◆ CreateFromConnectionString()

ShareFileClient Azure::Storage::Files::Shares::ShareFileClient::CreateFromConnectionString ( const std::string &  connectionString,
const std::string &  shareName,
const std::string &  fileName,
const ShareClientOptions options = ShareClientOptions() 
)
static
Parameters
connectionStringAzure Storage connection string.
shareNameThe name of a file share.
fileNameThe name of a file.
optionsOptional parameters used to initialize the client.
Returns
ShareClient The client that can be used to manage a share resource.

◆ Delete()

Azure::Response< Models::DeleteFileResult > Azure::Storage::Files::Shares::ShareFileClient::Delete ( const DeleteFileOptions options = DeleteFileOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to delete this file.
contextContext for cancelling long running operations.
Returns
Azure::Response<DeleteFileResult> containing the information returned when deleting the file.

◆ DeleteIfExists()

Azure::Response< Models::DeleteFileResult > Azure::Storage::Files::Shares::ShareFileClient::DeleteIfExists ( const DeleteFileOptions options = DeleteFileOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to delete this file.
contextContext for cancelling long running operations.
Returns
Azure::Response<DeleteFileResult> containing the information returned when deleting the file. Only valid when successfully deleted.

◆ Download()

Azure::Response< Models::DownloadFileResult > Azure::Storage::Files::Shares::ShareFileClient::Download ( const DownloadFileOptions options = DownloadFileOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to get the content of this file.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::DownloadFileResult> containing the range or full content and the information of the file.

◆ DownloadTo() [1/2]

Azure::Response< Models::DownloadFileToResult > Azure::Storage::Files::Shares::ShareFileClient::DownloadTo ( const std::string &  fileName,
const DownloadFileToOptions options = DownloadFileToOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
fileNameA file path to write the downloaded content to.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::DownloadFileToResult> containing the information of the downloaded file/file range.

◆ DownloadTo() [2/2]

Azure::Response< Models::DownloadFileToResult > Azure::Storage::Files::Shares::ShareFileClient::DownloadTo ( uint8_t *  buffer,
size_t  bufferSize,
const DownloadFileToOptions options = DownloadFileToOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
bufferA memory buffer to write the file content to.
bufferSizeSize of the memory buffer. Size must be larger or equal to size of the file or file range.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::DownloadFileToResult> containing the information of the downloaded file/file range.

◆ ForceCloseAllHandles()

ForceCloseAllFileHandlesPagedResponse Azure::Storage::Files::Shares::ShareFileClient::ForceCloseAllHandles ( const ForceCloseAllFileHandlesOptions options = ForceCloseAllFileHandlesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to close all this file's open handles.
contextContext for cancelling long running operations.
Returns
ForceCloseAllFileHandlesPagedResponse containing the information of the closed handles.

◆ ForceCloseHandle()

Azure::Response< Models::ForceCloseFileHandleResult > Azure::Storage::Files::Shares::ShareFileClient::ForceCloseHandle ( const std::string &  handleId,
const ForceCloseFileHandleOptions options = ForceCloseFileHandleOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
handleIdThe ID of the handle to be closed.
optionsOptional parameters to close one of this file's open handles.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::ForceCloseFileHandleResult> containing the information of the closed handle. Current empty but preserved for future usage.

◆ GetProperties()

Azure::Response< Models::FileProperties > Azure::Storage::Files::Shares::ShareFileClient::GetProperties ( const GetFilePropertiesOptions options = GetFilePropertiesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to get the properties of this file.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::FileProperties> containing the file properties.

◆ GetRangeList()

Azure::Response< Models::GetFileRangeListResult > Azure::Storage::Files::Shares::ShareFileClient::GetRangeList ( const GetFileRangeListOptions options = GetFileRangeListOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::GetFileRangeListResult> containing the valid ranges within the file for the specified range.

◆ GetRangeListDiff()

Azure::Response< Models::GetFileRangeListResult > Azure::Storage::Files::Shares::ShareFileClient::GetRangeListDiff ( std::string  previousShareSnapshot,
const GetFileRangeListOptions options = GetFileRangeListOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
previousShareSnapshotSpecifies the previous snapshot.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::GetFileRangeListResult> containing the valid ranges within the file for the specified range.

◆ GetUrl()

std::string Azure::Storage::Files::Shares::ShareFileClient::GetUrl ( ) const
inline
Returns
The file's primary URL endpoint.

◆ ListHandles()

ListFileHandlesPagedResponse Azure::Storage::Files::Shares::ShareFileClient::ListHandles ( const ListFileHandlesOptions options = ListFileHandlesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
optionsOptional parameters to list this file's open handles.
contextContext for cancelling long running operations.
Returns
ListFileHandlesPagedResponse describing the handles of the file.

◆ SetMetadata()

Azure::Response< Models::SetFileMetadataResult > Azure::Storage::Files::Shares::ShareFileClient::SetMetadata ( Storage::Metadata  metadata,
const SetFileMetadataOptions options = SetFileMetadataOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
metadataUser-defined metadata to be stored with the file. Note that the string may only contain ASCII characters in the ISO-8859-1 character set.
optionsOptional parameters to set this file's metadata.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::SetFileMetadataResult> containing the information of the file returned from the server.

◆ SetProperties()

Azure::Response< Models::SetFilePropertiesResult > Azure::Storage::Files::Shares::ShareFileClient::SetProperties ( const Models::FileHttpHeaders httpHeaders,
const Models::FileSmbProperties smbProperties,
const SetFilePropertiesOptions options = SetFilePropertiesOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
httpHeadersThe HTTP headers to be set to the file.
smbPropertiesThe SMB properties to be set to the file.
optionsOptional parameters to set this file's properties.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::SetFilePropertiesResult> containing the properties of the file returned from the server.

◆ StartCopy()

StartFileCopyOperation Azure::Storage::Files::Shares::ShareFileClient::StartCopy ( std::string  copySource,
const StartFileCopyOptions options = StartFileCopyOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
copySourceSpecifies the URL of the source file or file, up to 2 KB in length. To copy a file to another file within the same storage account, you may use Shared Key to authenticate the source file. If you are copying a file from another storage account, or if you are copying a file from the same storage account or another storage account, then you must authenticate the source file or file using a shared access signature. If the source is a public file, no authentication is required to perform the copy operation. A file in a share snapshot can also be specified as a copy source.
optionsOptional parameters to copy the content of this file.
contextContext for cancelling long running operations.
Returns
StartFileCopyOperation containing the copy related information.

◆ UploadFrom() [1/2]

Azure::Response< Models::UploadFileFromResult > Azure::Storage::Files::Shares::ShareFileClient::UploadFrom ( const std::string &  fileName,
const UploadFileFromOptions options = UploadFileFromOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
fileNameA file containing the content to upload.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::UploadFileFromResult> describing the state of the updated file.

◆ UploadFrom() [2/2]

Azure::Response< Models::UploadFileFromResult > Azure::Storage::Files::Shares::ShareFileClient::UploadFrom ( const uint8_t *  buffer,
size_t  bufferSize,
const UploadFileFromOptions options = UploadFileFromOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
bufferA memory buffer containing the content to upload.
bufferSizeSize of the memory buffer.
optionsOptional parameters to execute this function.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::UploadFileFromResult> describing the state of the updated file.

◆ UploadRange()

Azure::Response< Models::UploadFileRangeResult > Azure::Storage::Files::Shares::ShareFileClient::UploadRange ( int64_t  offset,
Azure::Core::IO::BodyStream &  content,
const UploadFileRangeOptions options = UploadFileRangeOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
offsetSpecifies the starting offset for the content to be written as a range.
contentA BodyStream containing the content of the range to upload.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::UploadFileRange> containing the information of the uploaded range and the file returned from the server.

◆ UploadRangeFromUri()

Azure::Response< Models::UploadFileRangeFromUriResult > Azure::Storage::Files::Shares::ShareFileClient::UploadRangeFromUri ( int64_t  destinationOffset,
const std::string &  sourceUri,
const Azure::Core::Http::HttpRange &  sourceRange,
const UploadFileRangeFromUriOptions options = UploadFileRangeFromUriOptions(),
const Azure::Core::Context &  context = Azure::Core::Context() 
) const
Parameters
destinationOffsetSpecifies the starting offset for the content to be written.
sourceUriThe source URI of the content to be uploaded.
sourceRangeThe source URI's range to be uploaded to file.
optionsOptional parameters to upload a range to file.
contextContext for cancelling long running operations.
Returns
Azure::Response<Models::UploadFileRangeFromUriResult> containing the returned information.

◆ WithShareSnapshot()

ShareFileClient Azure::Storage::Files::Shares::ShareFileClient::WithShareSnapshot ( const std::string &  shareSnapshot) const
Parameters
shareSnapshotThe snapshot identifier for the share snapshot.
Returns
A new ShareFileClient instance.
Remarks
Pass empty string to remove the snapshot returning the file client without specifying the share snapshot.

The documentation for this class was generated from the following files: