The route definition is simple based on FTP2 component.
Endpoint[sftp://server.com:22//path/to/file/?consumer.delay=900000&password=xxxxxx&username=user]
I am trying to read a file from a FTP folder.
JAXBContext jaxBContext = JAXBContext.newInstance(ObjectFactory.class);
Unmarshaller unmarshaller = jaxBContext.createUnmarshaller();
File authBatchFile = exchange.getIn().getBody(File.class);
AuthorizationFeed batchAuthFeed = (AuthorizationFeed) JAXBIntrospector
.getValue(unmarshaller.unmarshal(authBatchFile));
The exchange has everything it should have
Body [Body is file based: RemoteFile[fileName.txt]]
Header also shows the size of the file CamelFileLength=81612. However, I am getting the below exception just after the exchange trace.
java.lang.IllegalArgumentException: The value for the "java.io.File" parameter cannot be null.
at com.ibm.xml.xlxp2.jaxb.unmarshal.AbstractUnmarshallerImpl.reportNullParameter(AbstractUnmarshallerImpl.java:180)
at com.ibm.xml.xlxp2.jaxb.unmarshal.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:72)
at com.wellpoint.clihub.hie.um.camel.processor.BatchCFFProcessor.process(BatchCFFProcessor.java:47)