Spot the mistake in changing the working directory on the FTP server:
ftp.changeWorkingDirectory("newDirectory");
The method name is incorrect.
It's missing the confirmation check after changing the directory.
No mistake; the code is correct.
The argument should be a full path, not just a directory name.