class EL_COPIED_FILE_DATA_TEST_SET

(source code)

Client examples: COMPRESS_MANIFEST_COMMAND_TEST_SETCOPIED_SOURCES_TEST_SETEIFFEL_PARSING_TEST_SETFILE_LOCKING_TEST_SETFTP_BACKUP_TEST_SETFTP_PROTOCOL_TEST_SETJOBSERVE_SEARCHER_TEST_SETJPEG_FILE_INFO_COMMAND_TEST_SETLOCALE_COMPILER_TEST_SETMONTHLY_STOCK_USE_TEST_SETPROTEIN_FOLDING_TEST_SETPYXIS_EIFFEL_CONFIG_TEST_SETPYXIS_ENCRYPTER_TEST_SETPYXIS_TO_XML_TEST_SETRSA_PUBLIC_KEY_ENCRYPTION_TEST_SETSIMPLE_CLIENT_SERVER_TEST_SETTAGLIB_TEST_SETVCF_CONTACT_TEST_SETXML_TO_PYXIS_CONVERTER_TEST_SET

description

Copied file data test set

note
	description: "Copied file data test set"

	author: "Finnian Reilly"
	copyright: "Copyright (c) 2001-2022 Finnian Reilly"
	contact: "finnian at eiffel hyphen loop dot com"

	license: "MIT license (See: en.wikipedia.org/wiki/MIT_License)"
	date: "2024-09-25 11:42:23 GMT (Wednesday 25th September 2024)"
	revision: "10"

deferred class
	EL_COPIED_FILE_DATA_TEST_SET

inherit
	EL_FILE_DATA_TEST_SET
		redefine
			on_prepare
		end

	EL_SHARED_FIND_FILE_FILTER_FACTORY

feature {NONE} -- Events

	on_prepare
		local
			relative_path: FILE_PATH; relative_dir: DIR_PATH
			list: like source_file_list
		do
			Precursor
			list := source_file_list
			create file_list.make (list.count)
			across list as path loop
				relative_path := Work_area_dir.plus_file (path.item.relative_path (data_dir))
				relative_dir := relative_path.parent
				OS.File_system.make_directory (relative_dir)
				OS.copy_file (path.item, relative_dir)
				file_list.extend (relative_path)
			end
		end

feature {NONE} -- Implementation

	source_file_list: LIST [FILE_PATH]
		deferred
		end

	data_dir: DIR_PATH
		deferred
		end

	new_file_digest_table: EL_HASH_TABLE [EL_BYTE_ARRAY, FILE_PATH]
		do
			create Result.make (file_list.count)
			across file_list as list loop
				Result [list.item] := Digest.md5_plain_text (list.item)
			end
		end

feature {NONE} -- Internal attributes

	file_list: EL_FILE_PATH_LIST

end