This content has been marked as final.
Show 2 replies
-
1. Re: How to merge/add to an existing file from Smooks? FileOu
beve Sep 16, 2008 2:57 AM (in response to mike_ap)Hi,
not sure if you might have seen it already but there is a class named 'GetFileListFromExecutionContext' in the smooks_file_splitter_router quickstart.
This class has the following code in it:Object object = message.getBody().get("SmooksExecutionContext"); if ( object != null ) { List<String> listFileNames = FileListAccessor.getListFileNames( (Map) object ); }
Tthis gives you access the the list of file names created during the Smook transformation. You could then iterate through this list and merge the files into one large one.
Regards,
/Daniel -
2. Re: How to merge/add to an existing file from Smooks? FileOu
mike_ap Sep 16, 2008 3:55 PM (in response to mike_ap)Hi Daniel.
Thank you for the suggestion. However, the split fragments will not come all together at the same time. They may get routed to different services and different times before being written to the final file.
I will probably need to write a custom action that will append each fragment to a file if it already exists or write a new one.