-
Notifications
You must be signed in to change notification settings - Fork 535
Description
At #3415 (comment) @raprasad and I have been talking about how user's shouldn't need to switch to the SWORD API just to delete a file. This operation should be part of the native API. Yesterday, @djbrooke said to go ahead and create an issue for this so here it is.
For reference, here's how to delete a file with SWORD: http://guides.dataverse.org/en/4.5.1/api/sword.html#delete-a-file-by-database-id
The code SWORD uses is the deleteMediaResource method here: https://github.com/IQSS/dataverse/blob/v4.5.1/src/main/java/edu/harvard/iq/dataverse/api/datadeposit/MediaResourceManagerImpl.java#L131
At http://guides.dataverse.org/en/4.5.1/api/sword.html#known-issues we document a known issue with deleting files via SWORD (SWORD: deleting a file from a published version (not a draft) creates a draft but doesn't delete the file #2464 ) and I hope that we don't end up having the same problem with the native API. Highly related to that file delete issues is #2222 which should probably be consolidated, perhaps into this issue. There's a REST Assured test at for #2464 at https://github.com/IQSS/dataverse/blob/v4.5.1/src/test/java/edu/harvard/iq/dataverse/api/SearchIT.java#L645 but unfortunately the SearchIT class is not being run at https://build.hmdc.harvard.edu:8443/job/phoenix.dataverse.org-apitest-develop/ because of database deadlock issue (PSQLException: ERROR: deadlock detected running integration tests #2460) and because SearchIT is an old class that may not run well against a remote server (i.e. sending API commands across the wire from the Jenkins server to the phoenix server).