if !link_name
link_name = object.andand.default_name || resource_class.default_name
- if resource_class == Collection && Collection.is_empty_blob_locator?(link_uuid)
- link_name = "Empty Collection"
- end
-
if opts[:friendly_name]
if attrvalue.respond_to? :friendly_link_name
link_name = attrvalue.friendly_link_name
class Collection < ArvadosBase
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}(\\+.*)?\$")