Sha256: 88775b5e862099ac9e6e307702801828f5bb61d3071b00f3119801e49a8d4e31

Contents?: true

Size: 707 Bytes

Versions: 26

Compression:

Stored size: 707 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]])
      @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

26 entries across 26 versions & 1 rubygems

Version Path
riiif-2.4.0 app/resolvers/riiif/akubra_system_file_resolver.rb
riiif-2.3.0 app/resolvers/riiif/akubra_system_file_resolver.rb
riiif-2.2.0 app/resolvers/riiif/akubra_system_file_resolver.rb
riiif-2.1.0 app/resolvers/riiif/akubra_system_file_resolver.rb
riiif-1.7.1 lib/riiif/akubra_system_file_resolver.rb
riiif-2.0.0 app/resolvers/riiif/akubra_system_file_resolver.rb
riiif-2.0.0.beta2 app/resolvers/riiif/akubra_system_file_resolver.rb
riiif-2.0.0.beta1 app/resolvers/riiif/akubra_system_file_resolver.rb
riiif-1.7.0 lib/riiif/akubra_system_file_resolver.rb
riiif-1.6.0 lib/riiif/akubra_system_file_resolver.rb
riiif-1.5.1 lib/riiif/akubra_system_file_resolver.rb
riiif-1.5.0 lib/riiif/akubra_system_file_resolver.rb
riiif-1.4.4 lib/riiif/akubra_system_file_resolver.rb
riiif-1.4.3 lib/riiif/akubra_system_file_resolver.rb
riiif-1.4.2 lib/riiif/akubra_system_file_resolver.rb
riiif-1.4.1 lib/riiif/akubra_system_file_resolver.rb
riiif-1.4.0 lib/riiif/akubra_system_file_resolver.rb
riiif-1.3.0 lib/riiif/akubra_system_file_resolver.rb
riiif-1.2.0 lib/riiif/akubra_system_file_resolver.rb
riiif-1.1.3 lib/riiif/akubra_system_file_resolver.rb