/** * Find the input stream given the file name. */ private static InputStream findInputStream(String fileName) { if (fileName == null) { throw new NullPointerException("fileName is null?"); } try { File f = new File(fileName); if (f.exists()) { logger.debug(fileName + " found in file system"); return new FileInputStream(f); } else { InputStream in = findInClassPath(fileName); if (in != null) { logger.debug(fileName + " found in classpath"); } return in; } } catch (FileNotFoundException ex) { // already made the check so this // should never be thrown throw new RuntimeException(ex); } }
return new FileInputStream(f); } else { InputStream in = findInClassPath(fileName); if (in != null) { logger.fine(fileName + " found in classpath");
return new FileInputStream(f); } else { InputStream in = findInClassPath(fileName); if (in != null){ logger.fine(fileName+" found in classpath");