Spring boot: CsvReader class not reading filename from application.properties correctly

You need to either bring the CSVReader into spring. In this case, you can annotate CSVReader as a component and inject inputFilename into it, and use it.

Or, you can pass inputFilename to CSVReader via constructor and use it there.

    public class CsvReader {
        String inputFile ;
        public CsvReader(String inputFile ){
            this.inputFile =inputFile ;

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top