Yes, the file is already processed by a another application (PERL). When the file is processed by the perl application it will be placed in a folder where I had hoped to use the filesourceadapter to take the file and place it on a webserver and create a database entry for the file.
The filename would contain keys that would tell me which file belonged to which user.
The contents of the file are not really important to me, rather the filename itself.
I also see a use case were I would like to route a file based on its file name. for e.g if it has the text 'error' in it filename I'd like to route it to a different output directory.
I've since done this with Apache camel.
Code:
public class CamelRouteComponent extends RouteBuilder {
protected final Log log = LogFactory.getLog(getClass());
public void configure() throws Exception {
from("file:c:\\temp").convertBodyTo(File.class).to("bean:fileuploadService?methodName=process")
.setHeader(FileComponent.HEADER_FILE_NAME, el("${in.file.name}"));
}
}
Thanks
Paddy