Renames the specified file.
Namespace: DotNetNuke.Services.FileSystemAssembly: DotNetNuke (in DotNetNuke.dll)
Syntax
| C# |
|---|
public virtual IFileInfo RenameFile( IFileInfo file, string newFileName ) |
| Visual Basic |
|---|
Public Overridable Function RenameFile ( file As IFileInfo, newFileName As String ) As IFileInfo |
Parameters
- file
- Type: DotNetNuke.Services.FileSystem..::..IFileInfo
The file to rename
- newFileName
- Type: System..::..String
The new filename to assign to the file.
Return Value
An IFileInfo with the information of the renamed file.Implements
IFileManager..::..RenameFile(IFileInfo, String)
Exceptions
| Exception | Condition |
|---|---|
| System..::..ArgumentNullException | Thrown when file is null. |
| DotNetNuke.Services.FileSystem..::..FileAlreadyExistsException | Thrown when the folder already contains a file with the same name. |