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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -