Were the standard screens for your entity created by Studio?
When you open the entity editor, you see the table of external files related to it.
There are two actions “Add” and “Remove”.
The actions are intended to link and unlink the instance of your entity to files. In the case of many_to_many relation, it means that rows of link-table are created/removed.
Try to remove an instance from the entity browser: all related files should also be removed.
when you delete the FileDescriptor, the file itself will not be removed from file system of OS. Is this by design?
Yes. You can erase files using FileStorageAPI.removeFile(). Also, there is the findOrphanFiles() operation in app-core.cuba:type=FileStorage JMX bean - it can show you files that have no corresponding descriptors in the database.