The problem is that binary files are not removed after the resource itself or the resource's parent via the REST API.
To reproduce the problem do the following:
1. create a binary resource on an empty repository using the default ("file-simple") modeshape configuration.
curl -i -X POST --data-binary "@picture.jpg" "http://localhost:8080/rest/
2. find the file on the file system.
3. verify the MD5 of the original file and compare to the file in the binary directory to make sure you are looking at the right file.
4. Delete the resource curl -X DELETE "http://localhost:8080/rest/path/to/new/resource"
5. curl the resource to ensure that it is gone.
curl -v -i "http://localhost:8080/rest/path/to/new/resource"
6. verify that there are now two copies of the deleted binary: one in the /trash directory as well as the original file that was never deleted.
The same problem applies for children of deleted parents.