I'm using a class (Saxon xslt) that requires a number of XML style sheets be loaded:
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.Serializer;
import net.sf.saxon.s9api.XdmNode;
import net.sf.saxon.s9api.XsltCompiler;
import net.sf.saxon.s9api.XsltExecutable;
import net.sf.saxon.s9api.XsltTransformer;
XsltCompiler comp = (new Processor(false)).newXsltCompiler();
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream is = classloader.getResourceAsStream("xsl_files/main.xsl");
XsltExecutable exp exp = comp.compile(new StreamSource(is));
xsl_files is in the resource folder. main.xsl is loaded correctly, but main.xsl references other files that is in the xsl_files folder needed by Saxon's XsltCompiler but that isn't loaded from java resources. If I copy xsl_files into a physical folder on the hard drive, then I can simply use the following and all the files main.xsl uses is loaded correctly:
XsltExecutable exp = comp.compile(new StreamSource(new File("path/to/xsl_files/main.xsl")));
Any way around this to load the entire folder from java resources instead of a real path on the hard drive?