Class ShareFileRenameOptions
- java.lang.Object
-
- com.azure.storage.file.share.options.ShareFileRenameOptions
-
public final class ShareFileRenameOptions extends Object
Extended options that may be passed when renaming a file or directory.
-
-
Constructor Summary
Constructors Constructor Description ShareFileRenameOptions(String destinationPath)
Creates aShareFileRenameOptions
object.
-
Method Summary
-
-
-
Constructor Detail
-
ShareFileRenameOptions
public ShareFileRenameOptions(String destinationPath)
Creates aShareFileRenameOptions
object.- Parameters:
destinationPath
- Relative path from the share to rename the file to.
-
-
Method Detail
-
getDestinationPath
public String getDestinationPath()
- Returns:
- The path to which the file should be renamed.
-
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’t exist, the rename will succeed.
-
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’t exist, the rename will succeed.- Returns:
- The updated options.
-
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.
-
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.
-
getSourceRequestConditions
public ShareRequestConditions getSourceRequestConditions()
- Returns:
- Source request conditions. This parameter is only applicable if the source is a file.
-
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.
-
getDestinationRequestConditions
public ShareRequestConditions getDestinationRequestConditions()
- Returns:
- The destination request conditions.
-
setDestinationRequestConditions
public ShareFileRenameOptions setDestinationRequestConditions(ShareRequestConditions destinationRequestConditions)
- Parameters:
destinationRequestConditions
- The destination request conditions.- Returns:
- The updated options.
-
getFilePermission
public String getFilePermission()
- Returns:
- Optional file permission to set on the destination file or directory. The value in SmbProperties will be ignored.
-
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.
-
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.
-
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.
-
getMetadata
public Map<String,String> getMetadata()
- Returns:
- The metadata to associate with the renamed file.
-
setMetadata
public ShareFileRenameOptions setMetadata(Map<String,String> metadata)
- Parameters:
metadata
- The metadata to associate with the renamed file.- Returns:
- The updated options.
-
getContentType
public String getContentType()
Gets the content type.- Returns:
- The content type.
-
setContentType
public ShareFileRenameOptions setContentType(String contentType)
Sets the content type.- Parameters:
contentType
- the content type.- Returns:
- The updated options.
-
-