Java.IO.File.RenameTo Method
Renames this file to newPath.

Syntax

[Android.Runtime.Register("renameTo", "(Ljava/io/File;)Z", "GetRenameTo_Ljava_io_File_Handler")]
public virtual bool RenameTo (File dest)

Parameters

newPath
the new path.

Returns

Documentation for this section has not yet been entered.

Remarks

Renames this file to newPath. This operation is supported for both files and directories.

Many failures are possible. Some of the more likely failures include:

  • Write permission is required on the directories containing both the source and destination paths.
  • Search permission is required for all parents of both paths.
  • Both paths be on the same mount point. On Android, applications are most likely to hit this restriction when attempting to copy between internal storage and an SD card.

Note that this method does not throw IOException on failure. Callers must check the return value.

[Android Documentation]

Requirements

Namespace: Java.IO
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1