Add a function that gives all files of a resource element.

Use it to shorten the code of renaming and deleting resources.