# `MishkaCmsCore.Runtime.Resources.Validations.FolderIsEmpty`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/runtime/resources/__validations/folder_is_empty.ex#L5)

Refuses to archive or delete a media folder that still holds a file or another folder.

Archived ones count. An archived file still names its folder, and restoring it after the folder
went would leave it in none; an archived folder still names its parent the same way. So a folder
goes only once nothing at all is left in it — each file and folder moved out, or deleted for good.
That also keeps a delete for good clear of the references the database holds it to.

The rows are counted in their tables, archived ones included, whoever writes: the rule is about
the folder, not the actor. Each refusal is on `:id`, in the `errors` domain.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
