public function delete() : bool
    {
        $removed = null;

        if ($this->isDirectory()) {
            $removed = rmdir($this->realPath);
        } else {
            $removed = unlink($this->realPath);
        }

        return $removed;
    }