### Rename a Folder

This can be accomplished by using the JavaObject File Class.
The path can contain full and different path, which would be the same as moving a folder.
Reference: http://docs.oracle.com/javase/8/docs/api/java/io/File.html
`Sub renameFolder(source As String, target As String)
Dim joFolderSource As JavaObject
Dim joFolderTarget As JavaObject
' Create the Folder instances for the files (the constructor)
joFolderSource.InitializeNewInstance("java.io.File", Array As Object(source))
joFolderTarget.InitializeNewInstance("java.io.File", Array As Object(target))
' Rename file to
joFolderSource.RunMethod("renameTo", Array As Object(joFolderTarget))
End Sub`
Example
renameFolder(File.DirTemp & "\folderold\", File.DirTemp & "\foldernew\")
Hint
This approach can also be used for files.
See B4J HowTo "Rename a File"

Changed: , Category: Files, File: T6C193M1392.htm, ID: 1392