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.Gets the path to which the file should be renamed.Gets the destination request conditions.Gets the optional file permission to set on the destination file or directory.Gets the file permission format.Gets the metadata to associate with the renamed file.Gets a boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not.Gets the optional SMB properties to set on the destination file or directory.Gets the source request conditions.Gets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected.setContentType
(String contentType) Sets the content type.setDestinationRequestConditions
(ShareRequestConditions destinationRequestConditions) Sets the destination request conditions.setFilePermission
(String filePermission) Sets the optional file permission to set on the destination file or directory.setFilePermissionFormat
(FilePermissionFormat filePermissionFormat) Sets the file permission format.setIgnoreReadOnly
(Boolean ignoreReadOnly) Sets a boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected.setMetadata
(Map<String, String> metadata) Sets the metadata to associate with the renamed file.setReplaceIfExists
(Boolean replaceIfExists) Sets a boolean value which, if the destination file already exists, determines whether this request will overwrite the file or not.setSmbProperties
(FileSmbProperties smbProperties) Sets the optional SMB properties to set on the destination file or directory.setSourceRequestConditions
(ShareRequestConditions sourceRequestConditions) Sets the source request conditions.
-
Constructor Details
-
ShareFileRenameOptions
Creates aShareFileRenameOptions
object.- Parameters:
destinationPath
- Relative path from the share to rename the file to.- Throws:
NullPointerException
- IfdestinationPath
is null.
-
-
Method Details
-
getDestinationPath
Gets the path to which the file should be renamed.- Returns:
- The path to which the file should be renamed.
-
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’t exist, the rename will succeed.
-
setReplaceIfExists
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’t exist, the rename will succeed.- Returns:
- The updated options.
-
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.
-
setIgnoreReadOnly
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.
-
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.
-
getDestinationRequestConditions
Gets the destination request conditions.- Returns:
- The destination request conditions.
-
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.
-
setFilePermission
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.
-
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.
-
getMetadata
Gets the metadata to associate with the renamed file.- Returns:
- The metadata to associate with the renamed file.
-
setMetadata
Sets the metadata to associate with the renamed file.- 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.
-
getFilePermissionFormat
Gets the file permission format.- Returns:
- The file permission format.
-