I want to validate xml content against custom DTD on ingestion. I tried to store DTD's in a space inside company_home and tries to refer it through SAX Parser and it is throwing File Not found exception. Any suggestion to handle this issue?
It should work. But how are you reading the DTD? FileNotFound sounds like you are trying to read a file directly rather than an input stream. You should be able to use the content service to get an input stream for an InputStreamReader or similar class.
You need to find the node and then use the content service to get a content reader for that node Then you can create the InputSource with the input stream.
Or alternativly you may be able to specify the full URL /company_home/dtds rather than just a bit of the path.
I tried using InputStream from ContentReader and used it as part of InputSource. Again same error message. I am not sure how to get full URL of /company_home/dtds folder. Here is the code I used and it throws File Not found exception.