diff --git a/deploy/lib/server_config.rb b/deploy/lib/server_config.rb index 3b8e7180..a9203044 100644 --- a/deploy/lib/server_config.rb +++ b/deploy/lib/server_config.rb @@ -786,16 +786,21 @@ def save_files_to_fs(target_db, target_dir) if (uri.end_with?("/")) # create the directory so that it will exist when we try to save files Dir.mkdir("#{target_dir}" + uri) - else - r = execute_query %Q{ - fn:doc("#{uri}") - }, - { :db_name => target_db } - - body = JSON.parse(r.body)[0]['result'] - File.open("#{target_dir}#{uri}", 'w') { |file| file.write(body) } end end + r = execute_query %Q{ + for $uri in cts:uris() + return + xdmp:save( + "#{target_dir}" ||$uri, + fn:doc($uri), + + yes + + ) + }, + { :db_name => target_db } + end end