ShareFileRenameOptions Class

  • java.lang.Object
    • com.azure.storage.file.share.options.ShareFileRenameOptions

public final class ShareFileRenameOptions

Extended options that may be passed when renaming a file or directory.

Constructor Summary

Constructor Description
ShareFileRenameOptions(String destinationPath)

Creates a ShareFileRenameOptions object.

Method Summary

Modifier and Type Method and Description
String getContentType()

Gets the content type.

String getDestinationPath()

Gets the path to which the file should be renamed.

ShareRequestConditions getDestinationRequestConditions()

Gets the destination request conditions.

String getFilePermission()

Gets the optional file permission to set on the destination file or directory.

FilePermissionFormat getFilePermissionFormat()

Gets the file permission format.

Map<String,String> getMetadata()

Gets the metadata to associate with the renamed file.

Boolean getReplaceIfExists()

Gets a boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not.

FileSmbProperties getSmbProperties()

Gets the optional SMB properties to set on the destination file or directory.

ShareRequestConditions getSourceRequestConditions()

Gets the source request conditions.

Boolean isIgnoreReadOnly()

Gets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected.

ShareFileRenameOptions setContentType(String contentType)

Sets the content type.

ShareFileRenameOptions setDestinationRequestConditions(ShareRequestConditions destinationRequestConditions)

Sets the destination request conditions.

ShareFileRenameOptions setFilePermission(String filePermission)

Sets the optional file permission to set on the destination file or directory.

ShareFileRenameOptions setFilePermissionFormat(FilePermissionFormat filePermissionFormat)

Sets the file permission format.

ShareFileRenameOptions setIgnoreReadOnly(Boolean ignoreReadOnly)

Sets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected.

ShareFileRenameOptions setMetadata(Map<String,String> metadata)

Sets the metadata to associate with the renamed file.

ShareFileRenameOptions setReplaceIfExists(Boolean replaceIfExists)

Sets a boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not.

ShareFileRenameOptions setSmbProperties(FileSmbProperties smbProperties)

Sets the optional SMB properties to set on the destination file or directory.

ShareFileRenameOptions setSourceRequestConditions(ShareRequestConditions sourceRequestConditions)

Sets the source request conditions.

Methods inherited from java.lang.Object

Constructor Details

ShareFileRenameOptions

public ShareFileRenameOptions(String destinationPath)

Creates a ShareFileRenameOptions object.

Parameters:

destinationPath - Relative path from the share to rename the file to.

Method Details

getContentType

public String getContentType()

Gets the content type.

Returns:

The content type.

getDestinationPath

public String getDestinationPath()

Gets the path to which the file should be renamed.

Returns:

The path to which the file should be renamed.

getDestinationRequestConditions

public ShareRequestConditions getDestinationRequestConditions()

Gets the destination request conditions.

Returns:

The destination request conditions.

getFilePermission

public String getFilePermission()

Gets the optional file permission to set on the destination file or directory. The value in SmbProperties will be ignored.

Returns:

Optional file permission to set on the destination file or directory. The value in SmbProperties will be ignored.

getFilePermissionFormat

public FilePermissionFormat getFilePermissionFormat()

Gets the file permission format.

Returns:

The file permission format.

getMetadata

public Map getMetadata()

Gets the metadata to associate with the renamed file.

Returns:

The metadata to associate with the renamed file.

getReplaceIfExists

public Boolean getReplaceIfExists()

Gets a boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not.

Returns:

A boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn\u2019t exist, the rename will succeed.

getSmbProperties

public FileSmbProperties getSmbProperties()

Gets the optional SMB properties to set on the destination file or directory.

Returns:

Optional SMB properties to set on the destination file or directory. The only properties that are considered are file attributes, file creation time, file last write time, and file permission key. The rest are ignored.

getSourceRequestConditions

public ShareRequestConditions getSourceRequestConditions()

Gets the source request conditions. This parameter is only applicable if the source is a file.

Returns:

Source request conditions. This parameter is only applicable if the source is a file.

isIgnoreReadOnly

public Boolean isIgnoreReadOnly()

Gets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected.

Returns:

A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.

setContentType

public ShareFileRenameOptions setContentType(String contentType)

Sets the content type.

Parameters:

contentType - the content type.

Returns:

The updated options.

setDestinationRequestConditions

public ShareFileRenameOptions setDestinationRequestConditions(ShareRequestConditions destinationRequestConditions)

Sets the destination request conditions.

Parameters:

destinationRequestConditions - The destination request conditions.

Returns:

The updated options.

setFilePermission

public ShareFileRenameOptions setFilePermission(String filePermission)

Sets the optional file permission to set on the destination file or directory. The value in SmbProperties will be ignored.

Parameters:

filePermission - Optional file permission to set on the destination file or directory. The value in SmbProperties will be ignored.

Returns:

The updated options.

setFilePermissionFormat

public ShareFileRenameOptions setFilePermissionFormat(FilePermissionFormat filePermissionFormat)

Sets the file permission format.

Parameters:

filePermissionFormat - the file permission format.

Returns:

The updated options.

setIgnoreReadOnly

public ShareFileRenameOptions setIgnoreReadOnly(Boolean ignoreReadOnly)

Sets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected.

Parameters:

ignoreReadOnly - A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.

Returns:

The updated options.

setMetadata

public ShareFileRenameOptions setMetadata(Map metadata)

Sets the metadata to associate with the renamed file.

Parameters:

metadata - The metadata to associate with the renamed file.

Returns:

The updated options.

setReplaceIfExists

public ShareFileRenameOptions setReplaceIfExists(Boolean replaceIfExists)

Sets a boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not.

Parameters:

replaceIfExists - A boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn\u2019t exist, the rename will succeed.

Returns:

The updated options.

setSmbProperties

public ShareFileRenameOptions setSmbProperties(FileSmbProperties smbProperties)

Sets the optional SMB properties to set on the destination file or directory.

Parameters:

smbProperties - Optional SMB properties to set on the destination file or directory. The only properties that are considered are file attributes, file creation time, file last write time, and file permission key. The rest are ignored.

Returns:

The updated options.

setSourceRequestConditions

public ShareFileRenameOptions setSourceRequestConditions(ShareRequestConditions sourceRequestConditions)

Sets the source request conditions. This parameter is only applicable if the source is a file.

Parameters:

sourceRequestConditions - Source request conditions. This parameter is only applicable if the source is a file.

Returns:

The updated options.

Applies to