Method: Moab::StorageObjectVersion#find_filepath

Defined in:
lib/moab/storage_object_version.rb

#find_filepath(file_category, file_id) ⇒ Pathname



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/moab/storage_object_version.rb', line 70

def find_filepath(file_category, file_id)
  this_version_filepath = file_pathname(file_category, file_id)
  return this_version_filepath if this_version_filepath.exist?

  if file_category == 'manifest'
    msg = "manifest file #{file_id} not found for #{@storage_object.digital_object_id} - #{@version_id}"
    raise FileNotFoundException, msg
  end
  file_signature = file_inventory('version').file_signature(file_category, file_id)
  catalog_filepath = signature_catalog.catalog_filepath(file_signature)
  @storage_object.storage_filepath(catalog_filepath)
end