Race condition when workspace file deletion removes collection
Steps to reproduce
Similar to but on a different code path.
Reported on list (from TextAnalyzerServiceImpl.java) and seen on UCT production system.
2017-09-06 08:52:58,866 | WARN | pool-35-thread-331 | (ComposerServiceImpl:1286) - Error extracting image from http://media.uct.ac.za/files/mediapackage/429e419a-c222-4f73-9f5b-89ade79b0dca/72601e75-91d9-41f1-ab5a-f40506489e7e/presentation_e574b254_a673_4bf6_aa65_02b37a10b663.mp4
org.opencastproject.composer.api.EncoderException: Unable to put image file into the workspace
Caused by: java.io.FileNotFoundException: /data/opencast/work/shared/workspace/collection/composer/60136766_0.jpg (No such file or directory)
because the collection (in this case /data/opencast/work/shared/workspace/collection/composer/) has been removed by another thread.
The delete(URI uri) method should not remove the parent collection folder if the URI reference is to a file in a collection.