My application looks like this: Read in files, route them around for a bit, transform them to a POJO and back, then write them to disk again.
I'm using a FileWritingMessageHandler to write out my files and set
handler.setDeleteSourceFiles(true);
Now this works fine for the files i do not transform to a POJO, but i'm having some JSON files that i transform to POJO and later on back to a JSON file that i also want to write back and delete the old ones. I'm setting the OriginalFile Header and checking it before and after transforming it POJO back to JSON and it is the correct path, but it doesn't get deleted.
Does FileWritingMessageHandler ignore the header if it sees a message containing a file as payload? If so, how do i get it to delete the sourcefile without manually deleting it?
Edit
I looked a bit deeper at the implementation of FileWritingMessageHandler and it does indeed ignore the header if it's a File object. So i just have to manually delete it.