/** * Workhorse method for retrieving a resource from the file system. * * <p> * This method can be overridden by subclasses to provide customized handling of resource retrieval from file systems. * * @param name The resource name. * @param locale * The resource locale. * <br>Can be <jk>null</jk>. * @return The resource stream, or <jk>null</jk> if it couldn't be found. * @throws IOException */ protected InputStream findFileSystemResource(String name, Locale locale) throws IOException { if (name.indexOf("..") == -1) { for (String n2 : getCandidateFileNames(name, locale)) { File f = new File(n2); if (f.exists() && f.canRead() && ! f.isAbsolute()) { return new FileInputStream(f); } } } return null; } }
/** * Workhorse method for retrieving a resource from the file system. * * <p> * This method can be overridden by subclasses to provide customized handling of resource retrieval from file systems. * * @param name The resource name. * @param locale * The resource locale. * <br>Can be <jk>null</jk>. * @return The resource stream, or <jk>null</jk> if it couldn't be found. * @throws IOException */ protected InputStream findFileSystemResource(String name, Locale locale) throws IOException { if (name.indexOf("..") == -1) { for (String n2 : getCandidateFileNames(name, locale)) { File f = new File(n2); if (f.exists() && f.canRead() && ! f.isAbsolute()) { return new FileInputStream(f); } } } return null; } }
/** * Workhorse method for retrieving a resource from the file system. * * <p> * This method can be overridden by subclasses to provide customized handling of resource retrieval from file systems. * * @param name The resource name. * @param locale * The resource locale. * <br>Can be <jk>null</jk>. * @return The resource stream, or <jk>null</jk> if it couldn't be found. * @throws IOException */ protected InputStream findFileSystemResource(String name, Locale locale) throws IOException { if (name.indexOf("..") == -1) { for (String n2 : getCandidateFileNames(name, locale)) { File f = new File(n2); if (f.exists() && f.canRead() && ! f.isAbsolute()) { return new FileInputStream(f); } } } return null; } }