Class ShareFileRenameOptions
java.lang.Object
com.azure.storage.file.share.options.ShareFileRenameOptions
Extended options that may be passed when renaming a file or directory.
-
Constructor Summary
ConstructorsConstructorDescriptionShareFileRenameOptions
(String destinationPath) Creates aShareFileRenameOptions
object. -
Method Summary
Modifier and TypeMethodDescriptionGets the content type.setContentType
(String contentType) Sets the content type.setDestinationRequestConditions
(ShareRequestConditions destinationRequestConditions) setFilePermission
(String filePermission) setIgnoreReadOnly
(Boolean ignoreReadOnly) setMetadata
(Map<String, String> metadata) setReplaceIfExists
(Boolean replaceIfExists) setSmbProperties
(FileSmbProperties smbProperties) setSourceRequestConditions
(ShareRequestConditions sourceRequestConditions)
-
Constructor Details
-
ShareFileRenameOptions
Creates aShareFileRenameOptions
object.- Parameters:
destinationPath
- Relative path from the share to rename the file to.
-
-
Method Details
-
getDestinationPath
- Returns:
- The path to which the file should be renamed.
-
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
- 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
- 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
- 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
- Returns:
- Source request conditions. This parameter is only applicable if the source is a file.
-
getDestinationRequestConditions
- Returns:
- The destination request conditions.
-
getFilePermission
- Returns:
- Optional file permission to set on the destination file or directory. The value in SmbProperties will be ignored.
-
setFilePermission
- 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
- 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.
-
getMetadata
- Returns:
- The metadata to associate with the renamed file.
-
setMetadata
- Parameters:
metadata
- The metadata to associate with the renamed file.- Returns:
- The updated options.
-
getContentType
Gets the content type.- Returns:
- The content type.
-
setContentType
Sets the content type.- Parameters:
contentType
- the content type.- Returns:
- The updated options.
-