简介
本文档提供关于文件重命名的 API 概览以及 SDK 示例代码。
API | 操作描述 |
重命名或移动文件 |
重命名或移动文件
功能说明
用于重命名或移动文件。
示例代码
//源文件名val sourceName = "sourceName"//源文件夹val sourceDir = Directory()//目标文件名val targetName = "targetName"//目标文件夹val targetDir = Directory()try {val renameFileResponse: RenameFileResponse = smh.renameFile(targetName = targetName,targetDir = targetDir,sourceName = sourceName,sourceDir = sourceDir,//文件名冲突时策略conflictStrategy = ConflictStrategy.RENAME)} catch (e: Exception) {e.printStackTrace()}