yakworks.rally.common.DefaultCsvToMapTransformer.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rally-domain Show documentation
Show all versions of rally-domain Show documentation
gorm domain models for core app and testing
/*
* Copyright 2022 Yak.Works - Licensed under the Apache License, Version 2.0 (the "License")
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/
package yakworks.rally.common
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.springframework.context.annotation.Lazy
import org.springframework.core.io.Resource
import org.springframework.stereotype.Service
import yakworks.commons.io.ZipUtils
import yakworks.commons.lang.Validate
import yakworks.etl.csv.CSVPathKeyMapReader
import yakworks.etl.csv.CsvToMapTransformer
import yakworks.rally.attachment.model.Attachment
/**
* Read CSV from attachment with CSVPathKeyMapReader and transforms to List of maps
*/
@Service @Lazy
@Slf4j
@CompileStatic
class DefaultCsvToMapTransformer implements CsvToMapTransformer {
/**
* Reads CSV rows into maps
*
* @param params map with
* - attachmentId
* - dataFilename : name of csv file inside zip
* - headerPathDelimiter : Header delimeter
*
* @return List