As for FTP, it has response codes which the server sends after it processes a command. Your code can look at these codes and see whether the command was successful, or why it wasn't.
However if you're using a package which does FTP for you, that package will do exactly that and then report back to your code which calls it. Perhaps it would throw an exception or something, at any rate it would be documented. You should be using a package which somebody else has already written, rather than trying to write your own.
And RMI has nothing to do with FTP, and vice versa, so what did you want to ask about RMI?