get current date in yyyyMMdd format in spring batch configuration XML -
i have spring batch configuration spring outbound sftp has
<property name="remotedirectory" value="/sftp/books_file_20160629"></property>
i want _20160629 today's date in same yyyymmdd format rather hard coding.
please tell me there way ?
thanks,
aiden
are looking this
<property name="resources" value="/sftp/books_file_*#{currentdate}"/>
below beans should added in context.xml
<bean id="fastdateformat" class="org.apache.commons.lang.time.fastdateformat" factory-method="getinstance"> <constructor-arg value="yyyymmdd" /> </bean> <bean id="currentdate" class="java.util.date" factory-bean="fastdateformat" factory-method="format"> <constructor-arg> <bean class="java.util.date" /> </constructor-arg> </bean>
Comments
Post a Comment