In my spring boot batch (2.7.3) application.properties file I have:
rs.input.path=/opt/ingestiondata/rs
Afterthat, when I do a mvn clean install on my windows machine, I get the jar file in my target folder. When I try to do java -jar myjar.jar on my local windows command prompt, it give (as expected, as there is no such path) exception - java.nio.file.NoSuchFileException: \opt\ingestiondata\rs
Then I move the same jar file to the linux box there when I do java -jar myjar.jar my key rs.input.path get evaluated to a windows path - c:\users\ajay\some\dir.
What can be wrong here? As I am using the same jar. Its odd but its what happening since last couple of hours. Tried and verified killall java etc etc and now running out of options. Any pointers/help will be greatly appreciated. Must be something trivial and something horrible I am expecting.
Update: As asked by Abhijit, this is how this is being used.
@Value("${rs.input.path}")
private String inputPath;
@Bean
ItemReader<File> myReader() throws IOException {
List<File> files = Files.walk(Paths.get(inputPath))
.filter(Files::isRegularFile)
.map(Path::toFile)
.collect(Collectors.toList());
return new IteratorItemReader<>(files);
}