XiLiAN is right, depending on the server-software, deleting the active directory could force an error and fail. The command could do a cd .. before the delete, but that could mean you would be able to try to delete the top-dir. Depending on the code, that could result in deleting all the files and dirs BEFORE it fails.
XiLiAN's method is preferable.