def decompose(data)
unzip(data) do |zip|
zip.each do |entry|
next unless entry.file?
case entry.encryption_codec
when Archive::Zip::Codec::NullEncryption
else
raise EncryptedError.new(data)
end
entry_uri = data.uri.dup
base_path = entry_uri.path.gsub(/\.zip\z/i, "")
path_converter = PathConverter.new(entry.zip_path,
encoding: base_path.encoding,
uri_escape: true)
entry_uri.path = "#{base_path}/#{path_converter.convert}"
entry_data = VirtualFileData.new(entry_uri,
entry.file_data,
source_data: data)
yield(entry_data)
end
end
end