I'd like to adjust my code to make the Spring Batch reader
to read the resource file not from class path, but from the file system (like C:\inputData.xml). Is there any way, how to make it? My current code looks like this and reads given xml
file from resources folder just fine:
@Bean
ItemReader<FamilyBatchEntity> xmlFamilyFileItemReader() {
StaxEventItemReader<FamilyBatchEntity> xmlFileReader = new StaxEventItemReader<>();
xmlFileReader.setResource(new ClassPathResource("inputData.xml"));
xmlFileReader.setFragmentRootElementName("Familiendetails");
Jaxb2Marshaller insurantMarshaller = new Jaxb2Marshaller();
insurantMarshaller.setClassesToBeBound(FamilyBatchEntity.class);
xmlFileReader.setUnmarshaller(insurantMarshaller);
return xmlFileReader;
}