I am writing a system that reads in XML files and processes the data. The core part of this system is nearly complete. I now have a requirement that allows users to submit image documents (e.g. jpg, jpeg, pdf, png, tif, and tiff) into a particular folder location. At a high level, when these files arrive, my process routes these files to another folder based on the filename. This works well enough for the more simple case, but I don't think it scales very well when you consider there may be more destination folders with more complex rules that determine the proper routing. I would like to take an approach based on reading metadata inside the files -- I understand that some files may have a file header section that is separate from the actual data.
This seems like it would be straightforward with
However, I think that was introduced with the NIO in
Java 7. Right now, I have a requirement to run on servers that are running Java 6. My first preference would be to find a way to code this in Java without too much effort and without relying on a third party solution. Any ideas?