'Date format in Spring Batch Excel

I'm trying to read an Excel file with Spring Batch and Spring Batch Excel and cells in date format are read in a different format form the file.

In my file dates are in DD/MM/YYYY and when Spring/POI are reading data org.apache.poi.ss.usermodel.DataFormatter is used and in performDateFormatting method the parameter dateFormat has a pattern of M/d/yy.

Is there a way to force the date pattern when reading ?

My rowmapper configuration is

<bean id="caricaAnagraficheReader" class="org.springframework.batch.extensions.excel.poi.PoiItemReader" scope="step">
    <property name="resource" value="file:#{batchParameters.genericBatchParameters.allegatoNomeCompleto}" />
    <property name="linesToSkip" value="1" />
    <property name="rowMapper">
        <bean class="it.blue.batch.portali.components.CaricaAnagraficheRowMapper" />
    </property>
</bean>

Thank you in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source