From 17b1a10d300bf6307848f51770944189984db69e Mon Sep 17 00:00:00 2001 From: Fred Duby Date: Thu, 7 Nov 2024 09:18:55 -0500 Subject: [PATCH] Add configurable subdir prefix to path relative to Hyacinth upload dir (SWORD-114) --- config/templates/hyacinth.template.yml.erb | 1 + lib/sword/adapters/hyacinth_adapter.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/templates/hyacinth.template.yml.erb b/config/templates/hyacinth.template.yml.erb index 02d08c3..3d3eeb1 100644 --- a/config/templates/hyacinth.template.yml.erb +++ b/config/templates/hyacinth.template.yml.erb @@ -1,5 +1,6 @@ base: &BASE upload_directory: "tmp/uploads" + upload_subdir_prefix: "sword" use_ssl: true store_digital_object_data: false payload_dir: 'tmp/sword' diff --git a/lib/sword/adapters/hyacinth_adapter.rb b/lib/sword/adapters/hyacinth_adapter.rb index e315073..4ff2ab5 100644 --- a/lib/sword/adapters/hyacinth_adapter.rb +++ b/lib/sword/adapters/hyacinth_adapter.rb @@ -98,7 +98,7 @@ def compose_internal_format_asset(parent_pid, def ingest_asset(parent_pid, document_filepath) - asset_import_subdir = "swordtmp_#{parent_pid}" + asset_import_subdir = File.join(HYACINTH_CONFIG[:upload_subdir_prefix],"swordtmp_#{parent_pid}") asset_import_subdir.gsub!(':','') # puts'*************************asset import dir***********************' # puts asset_import_subdir