Method: OcflTools::OcflValidator#validate_ocfl_object_root

Defined in:
lib/ocfl_tools/ocfl_validator.rb

#validate_ocfl_object_root(digest: nil) ⇒ OcflTools::OcflResults

Perform an OCFL-spec validation of the given object directory. If given the optional digest value, verify file content using checksums in inventory file will fail if digest is not found in manifest or a fixity block. This validates all versions and all files in the object_root. If you want to just check a specific version, call #verify_directory.

Parameters:

  • digest (String) (defaults to: nil)

    optional digest to use, if one wishes to use values in the fixity block instead of the official OCFL digest values.

Returns:



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/ocfl_tools/ocfl_validator.rb', line 47

def validate_ocfl_object_root(digest: nil)
  # calls verify_structure, verify_inventory and verify_checksums.
  verify_structure
  verify_inventory # returns a diff. results object; merge it?
  verify_manifest
  if !digest.nil?
    verify_fixity(digest: digest)
  else
    verify_checksums
  end
  results # this copies verify.results into our main results object, if it exists.
end