Class: Riiif::AkubraSystemFileResolver
- Inherits:
-
AbstractFileSystemResolver
- Object
- AbstractFileSystemResolver
- Riiif::AkubraSystemFileResolver
- Defined in:
- app/resolvers/riiif/akubra_system_file_resolver.rb
Instance Attribute Summary collapse
-
#akubraconfig ⇒ Object
Returns the value of attribute akubraconfig.
-
#imagetype ⇒ Object
Returns the value of attribute imagetype.
-
#pathroot ⇒ Object
Returns the value of attribute pathroot.
Attributes inherited from AbstractFileSystemResolver
Instance Method Summary collapse
-
#initialize(pr = '/yourfedora/data/datastreamStore/', ir = 'jp2', ac = [[0, 2], [2, 2], [4, 1]]) ⇒ AkubraSystemFileResolver
constructor
A new instance of AkubraSystemFileResolver.
- #pattern(id) ⇒ Object
Methods inherited from AbstractFileSystemResolver
Constructor Details
#initialize(pr = '/yourfedora/data/datastreamStore/', ir = 'jp2', ac = [[0, 2], [2, 2], [4, 1]]) ⇒ AkubraSystemFileResolver
Returns a new instance of AkubraSystemFileResolver.
7 8 9 10 11 12 |
# File 'app/resolvers/riiif/akubra_system_file_resolver.rb', line 7 def initialize(pr = '/yourfedora/data/datastreamStore/', ir = 'jp2', ac = [[0, 2], [2, 2], [4, 1]]) super() @pathroot = pr @imagetype = ir @akubraconfig = ac end |
Instance Attribute Details
#akubraconfig ⇒ Object
Returns the value of attribute akubraconfig.
5 6 7 |
# File 'app/resolvers/riiif/akubra_system_file_resolver.rb', line 5 def akubraconfig @akubraconfig end |
#imagetype ⇒ Object
Returns the value of attribute imagetype.
5 6 7 |
# File 'app/resolvers/riiif/akubra_system_file_resolver.rb', line 5 def imagetype @imagetype end |
#pathroot ⇒ Object
Returns the value of attribute pathroot.
5 6 7 |
# File 'app/resolvers/riiif/akubra_system_file_resolver.rb', line 5 def pathroot @pathroot end |
Instance Method Details
#pattern(id) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/resolvers/riiif/akubra_system_file_resolver.rb', line 14 def pattern(id) fullpid = "info:fedora/#{id}/#{@imagetype}/#{@imagetype}.0" md5 = Digest::MD5.new md5.update fullpid digest = md5.hexdigest directorystr = '' @akubraconfig.each { |a| directorystr << digest[a[0], a[1]] << '/' } filename = CGI.escape(fullpid) @pathroot + directorystr + filename end |