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()
ShareRequestConditions getDestinationRequestConditions()
String getFilePermission()
FilePermissionFormat getFilePermissionFormat()

Gets the file permission format.

Map<String,String> getMetadata()
Boolean getReplaceIfExists()
FileSmbProperties getSmbProperties()
ShareRequestConditions getSourceRequestConditions()
Boolean isIgnoreReadOnly()
ShareFileRenameOptions setContentType(String contentType)

Sets the content type.

ShareFileRenameOptions setDestinationRequestConditions(ShareRequestConditions destinationRequestConditions)
ShareFileRenameOptions setFilePermission(String filePermission)
ShareFileRenameOptions setFilePermissionFormat(FilePermissionFormat filePermissionFormat)

Sets the file permission format.

ShareFileRenameOptions setIgnoreReadOnly(Boolean ignoreReadOnly)
ShareFileRenameOptions setMetadata(Map<String,String> metadata)
ShareFileRenameOptions setReplaceIfExists(Boolean replaceIfExists)
ShareFileRenameOptions setSmbProperties(FileSmbProperties smbProperties)
ShareFileRenameOptions setSourceRequestConditions(ShareRequestConditions sourceRequestConditions)

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()

Returns:

The path to which the file should be renamed.

getDestinationRequestConditions

public ShareRequestConditions getDestinationRequestConditions()

Returns:

The destination request conditions.

getFilePermission

public String getFilePermission()

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()

Returns:

The metadata to associate with the renamed file.

getReplaceIfExists

public Boolean getReplaceIfExists()

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()

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()

Returns:

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

isIgnoreReadOnly

public Boolean isIgnoreReadOnly()

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)

Parameters:

destinationRequestConditions - The destination request conditions.

Returns:

The updated options.

setFilePermission

public ShareFileRenameOptions setFilePermission(String filePermission)

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)

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)

Parameters:

metadata - The metadata to associate with the renamed file.

Returns:

The updated options.

setReplaceIfExists

public ShareFileRenameOptions setReplaceIfExists(Boolean replaceIfExists)

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)

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)

Parameters:

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

Returns:

The updated options.

Applies to