public function rmdir(string $dir)
{
foreach ($this->sendAllRequests($this->createAllRequests($this->getDirPath($dir), self::METHOD_DELETE)) as $response) {
// 204 means deleted
if (self::STATUS_204_NO_CONTENT !== $response->getStatusCode()) {
throw new DirectoryNotDeletedException(sprintf('Directory %s cannot be deleted.', $dir));
}
}
}