Hi , i am using spring-integration-2.1.0 . I am copying the file using integration.xml . The code is as follows .

<bean id="fileInChannel" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
<property name="location">
<value>/WEB-INF/file.properties</value>
</property>
</bean>
<bean id="fileHandler" class="com.kensho.dms.intg.FileCopyHandler" scope="singleton" />
<file:inbound-channel-adapter id="inputSource" directory="file:${input.directory}" prevent-duplicates="false" channel="fileInputChannel" >
<integrationoller id="filePoller" fixed-rate="10" />
</file:inbound-channel-adapter>



<integration:channel id="fileInputChannel" />


<integration:chain input-channel="fileInputChannel" output-channel="fileProcessChannel" >
<integration:service-activator ref="fileHandler" method="handleFile" />
</integration:chain>

<integration:channel id="fileProcessChannel" />

<file:outbound-channel-adapter id="staging" directory="${output.directory}" delete-source-files="true" channel="fileProcessChannel" />

</beans>



after copying the file i am deleting the souce file using following code .

<file:outbound-channel-adapter id="staging" directory="${output.directory}" delete-source-files="true" channel="fileProcessChannel" />


Till here every things works great . Now i want to check , if any duplicate file arrives in output directory then rename it . Any solution is welcome .