lib/ddr/models/has_intermediate_file.rb in ddr-models-2.8.0 vs lib/ddr/models/has_intermediate_file.rb in ddr-models-2.9.0.rc1
- old
+ new
@@ -11,8 +11,31 @@
control_group: "E"
include FileManagement
end
+ def intermediate_type
+ datastreams[Ddr::Datastreams::INTERMEDIATE_FILE].mimeType
+ end
+
+ def intermediate_extension
+ extensions = Ddr::Models.preferred_file_extensions
+ if extensions.include? intermediate_type
+ extensions[intermediate_type]
+ else
+ intermediate_extension_default
+ end
+ end
+
+ def intermediate_path
+ datastreams[Ddr::Datastreams::INTERMEDIATE_FILE].file_path
+ end
+
+ private
+
+ def intermediate_extension_default
+ datastreams[Ddr::Datastreams::INTERMEDIATE_FILE].default_file_extension
+ end
+
end
end
end