public void rmd(String path) throws PermissionDeniedException, AccessControlException, IOException {
File directory = resolveFile(path);
String ftpPathToDir = resolvePath(directory);
// we want to check the permissions in the directory that contains the directory we are aiming for, and since RMD can take parameters with full path names, we need to check in the parent
if (ftpPathToDir == null || !ServiceManager.getServices().getPermissions().hasPermission(ActionPermission.RMDIR, ftpPathToDir, user)) {
throw new PermissionDeniedException(ActionPermission.RMDIR, ftpPathToDir, user);
}
if (directory.exists()) {
if (directory.isDirectory()) {
if (isEmpty(directory)) {
// apparently we need to delete the hidden files first, since rmd.delete() will not succeed if there are files left in the directory.