// create parent directories if needed - true
fileMgr.makeDirectory(dirPath, dc, true);
String srcPath = basePath + "/Nostalgia011.vmdk";
String dstPath = dirPath + "/copy of Nostalgia011.vmdk";
Task cTask = fileMgr.copyDatastoreFile_Task(srcPath, dc,
dstPath, dc, true);
if(cTask.waitForMe()==Task.SUCCESS)
{
System.out.println("File copied successfully!");