' Rename a file - Path can contain full and different path, which would be the same as moving a file
' Class Reference: http://docs.oracle.com/javase/8/docs/api/java/io/File.html
Sub renameFile(source As String, target As String)
Dim joFileSource As JavaObject
Dim joFileTarget As JavaObject
' Create the file instances for the files (the constructor)
joFileSource.InitializeNewInstance("java.io.File", Array As Object(source))
joFileTarget.InitializeNewInstance("java.io.File", Array As Object(target))
' Rename source file to target file
joFileSource.RunMethod("renameTo", Array As Object(joFileTarget))
End Sub