Merge branch '2328-keep-permission-flags' (closes #2328)
[arvados.git] / apps / workbench / app / models / collection.rb
index 6bc55bde3d21199fda4c31fa3143800d9b03c026..a63bf90cb006d450f7dccf958ec06aa83fa67d24 100644 (file)
@@ -1,4 +1,16 @@
 class Collection < ArvadosBase
+  include ApplicationHelper
+
+  MD5_EMPTY = 'd41d8cd98f00b204e9800998ecf8427e'
+
+  # 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 content_summary
+    human_readable_bytes_html(total_bytes) + " " + super
+  end
 
   def total_bytes
     if files