- @files = []
- tmp.each do |k, v|
- re = k.match(/^(.+)\/(.+)/)
- @files << [re[1], re[2], v]
+ @files = []
+ tmp.each do |k, v|
+ re = k.match(/^(.+)\/(.+)/)
+ @files << [re[1], re[2], v]
+ end
+ end
+
+ def self.uuid_like_pattern
+ "________________________________+%"
+ end
+
+ def self.normalize_uuid uuid
+ hash_part = nil
+ size_part = nil
+ uuid.split('+').each do |token|
+ if token.match /^[0-9a-f]{32,}$/
+ raise "uuid #{uuid} has multiple hash parts" if hash_part
+ hash_part = token
+ elsif token.match /^\d+$/
+ raise "uuid #{uuid} has multiple size parts" if size_part
+ size_part = token