Class: Moab::SignatureCatalogEntry

Inherits:
Serializable
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/moab/signature_catalog_entry.rb

Overview

Note:

Copyright © 2012 by The Board of Trustees of the Leland Stanford Junior University. All rights reserved. See LICENSE for details.

A file-level entry in a digital object’s SignatureCatalog. It has a child FileSignature element that identifies the file’s contents (the bytestream) along with data that specfies the SDR storage location that was used to preserve a single file instance.

Data Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ SignatureCatalogEntry

Returns a new instance of SignatureCatalogEntry.



24
25
26
# File 'lib/moab/signature_catalog_entry.rb', line 24

def initialize(opts={})
  super(opts)
end

Instance Attribute Details

#group_idString

Returns The name of the file group.

Returns:

  • (String)

    The name of the file group



34
# File 'lib/moab/signature_catalog_entry.rb', line 34

attribute :group_id, String, :tag => 'groupId', :key => true

#pathString

Returns The id is the filename path, relative to the file group’s base directory.

Returns:

  • (String)

    The id is the filename path, relative to the file group’s base directory



38
# File 'lib/moab/signature_catalog_entry.rb', line 38

attribute :path, String, :key => true, :tag => 'storagePath'

#signatureFileSignature

Returns The fixity data of the file instance.

Returns:



42
# File 'lib/moab/signature_catalog_entry.rb', line 42

element :signature, FileSignature, :tag => 'fileSignature'

#version_idInteger

Returns The ordinal version number.

Returns:

  • (Integer)

    The ordinal version number



30
# File 'lib/moab/signature_catalog_entry.rb', line 30

attribute :version_id, Integer, :tag => 'originalVersion', :key => true, :on_save => Proc.new {|n| n.to_s}

Instance Method Details

#storage_pathString

Returns the storage path to a file, relative to the object storage home directory

Returns:

  • (String)

    Returns the storage path to a file, relative to the object storage home directory



55
56
57
# File 'lib/moab/signature_catalog_entry.rb', line 55

def storage_path
  File.join(StorageObject.version_dirname(version_id),'data', group_id, path)
end