Sha256: 8ac44a34afb7052b865d0538e8d04080c50b108e0bfa87e875e3da013e86ce86
Contents?: true
Size: 721 Bytes
Versions: 4
Compression:
Stored size: 721 Bytes
Contents
require 'digest' require 'cgi' module Riiif class AkubraSystemFileResolver < AbstractFileSystemResolver attr_accessor :pathroot, :imagetype, :akubraconfig def initialize(pr = '/yourfedora/data/datastreamStore/', ir = 'jp2', ac = [[0, 2], [2, 2], [4, 1]]) super() @pathroot = pr @imagetype = ir @akubraconfig = ac end 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 end end
Version data entries
4 entries across 4 versions & 2 rubygems