Renames the specified file.

Namespace: DotNetNuke.Services.FileSystem
Assembly: 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

ExceptionCondition
System..::..ArgumentNullExceptionThrown when file is null.
DotNetNuke.Services.FileSystem..::..FileAlreadyExistsExceptionThrown when the folder already contains a file with the same name.

See Also