SFULibrary / islandora_rest_ingester

Command-line tool for ingesting objects via the Islandora REST interface
The Unlicense
3 stars 0 forks source link

Provide option to overwrite existing datastreams #4

Closed mjordan closed 7 years ago

mjordan commented 7 years ago

The Islandora REST interface returns an HTTP 409: Conflict with the message "Datastream already exists" if you attempt to create a datastream that is already present. This includes RELS-EXT. One situation where this can happen is for datastreams that are derivatives (TN, MEDIUM_SIZE, etc.).

Before creating a datastream, we should check to see if it already exists, and if so, optionally update it or not. The option could be --update_datastreams. If set to true, the ingester would update the datastream content; if set of false, the ingester would skip updating the datastream content.

mjordan commented 7 years ago

As of 5997102d6a4458f6681231026982905fb2d8c2ef, if a datastream already exists (for example, a TN created as a derivative), and there is a datastream file in the input directory that would otherwise trigger the ingestion of the datastrea, the datastream's content is updated from the file. The check for the existence of the datastream is logged (HTTP response code 200 if it exists, 404 if it does not).

If there is a use case for not updating the datastream content, we can add a command-line option for it later.