Hi everyone,
I apologise in advance if there's been already a discussion on this matter. As I've yet to find it, please redirect me there and close/remove this thread.
Scenario: batch app that monitors remote folder via sftp, transfers files and processes them
Problem: using a property to define whether my "sftp:inbound-channel-adapter" should "delete-remote-files". Using the snippet below I encountered the following error:
Offending resource: class path resource [launch-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 14 in XML document from class path resource [META-INF/spring/si-module-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '${delete-remote-files}' is not a valid value for 'boolean'.
Context snippet:
Code:<sftp:inbound-channel-adapter id="sftpInboundAdapter" channel="inputDirChannel" session-factory="sftpSessionFactory" local-directory="file:${local.dir}" remote-directory="${remote.dir}" filename-pattern="${filename-pattern}" temporary-file-suffix="INC" auto-startup="${sftp.enabled}" delete-remote-files="${delete-remote-files}" > <int:poller ref="poller" /> </sftp:inbound-channel-adapter>
Any help in overcoming this issue is greatly appreciated.
P.S. latest idea that came to mind as a workaround is to define a different channel adapter for both true/false, each in its own xml, and then include the right one based on the value of the property, but I'd prefer a more elegant solution.
Kind regards,
M


Reply With Quote