+ MD5_EMPTY = 'd41d8cd98f00b204e9800998ecf8427e'
+
+ def default_name
+ if Collection.is_empty_blob_locator? self.uuid
+ "Empty Collection"
+ else
+ super
+ end
+ end
+
+ # Return true if the given string is the locator of a zero-length blob
+ def self.is_empty_blob_locator? locator
+ !!locator.to_s.match("^#{MD5_EMPTY}(\\+.*)?\$")
+ end
+
+ def self.goes_in_projects?
+ true
+ end
+
+ def manifest
+ if @manifest.nil? or manifest_text_changed?
+ @manifest = Keep::Manifest.new(manifest_text || "")
+ end
+ @manifest
+ end
+
+ def files
+ # This method provides backwards compatibility for code that relied on
+ # the old files field in API results. New code should use manifest
+ # methods directly.
+ manifest.files
+ end
+
+ def content_summary
+ ApplicationController.helpers.human_readable_bytes_html(total_bytes) + " " + super
+ end