public function unlink(string $path)
{
// We do not delete directories
if ($this->isDir($path)) {
throw new FileNotDeletedException(sprintf('The path %s is a directory.', $path));
}
foreach ($this->sendAllRequests($this->createAllRequests($this->getFilePath($path), self::METHOD_DELETE)) as $response) {
switch ($response->getStatusCode()) {
case self::STATUS_200_OK:
case self::STATUS_204_NO_CONTENT:
// Means deleted
// Means deleted
case self::STATUS_404_NOT_FOUND:
break;
default:
throw new FileNotDeletedException(sprintf('File %s cannot be deleted.', $path));
}
}
}