Gets an input source for the given file name. @param fname The file name @param jar The JAR, or null @param ctxt The compilation context @return the input source @throws IOException if an I/O error occurs
(String fname, Jar jar, JspCompilationContext ctxt)
| 734 | * @throws IOException if an I/O error occurs |
| 735 | */ |
| 736 | public static InputSource getInputSource(String fname, Jar jar, JspCompilationContext ctxt) throws IOException { |
| 737 | InputSource source; |
| 738 | if (jar != null) { |
| 739 | String jarEntryName = fname.substring(1); |
| 740 | source = new InputSource(jar.getInputStream(jarEntryName)); |
| 741 | source.setSystemId(jar.getURL(jarEntryName)); |
| 742 | } else { |
| 743 | source = new InputSource(ctxt.getResourceAsStream(fname)); |
| 744 | source.setSystemId(ctxt.getResource(fname).toExternalForm()); |
| 745 | } |
| 746 | return source; |
| 747 | } |
| 748 | |
| 749 | /** |
| 750 | * Gets the fully-qualified class name of the tag handler corresponding to the given tag file path. |
no test coverage detected