code: public static InputStream getInputStream(final File resource) throws IOException {
  		if (resource.exists()) {
  			return new FileInputStream(resource);
  		}
  		LOG.info("Could not find file '" + resource.getAbsolutePath() + "' in the file system. Trying to load it from the classpath...");
  
  		String path = FilenameUtils.separatorsToUnix(resource.getPath());
  		ClassLoader cl = Thread.currentThread().getContextClassLoader();
  
  		InputStream is = cl.getResourceAsStream(path);
  
  		if (is == null) {
  			if (path.startsWith("/")) {
  				LOG.info("Could not find file '" + resource
  						+ " in the file system. Trying to load it from the classpath without the leading slash...");
  				is = cl.getResourceAsStream(path.substring(1));
  			}
  
  			if (is == null) {
  				// If configs are to be loaded from the classpath, we also try it directly
  				// stripping of the config directory
  				String configDir = new File(getConfigDir()).getName();
  				if (path.startsWith(configDir)) {
  					is = cl.getResourceAsStream(StringUtils.substringAfter(path, configDir + '/'));
  				}
  			}
  
  			if (is == null) {
  				throw new FileNotFoundException("Could not load file '" + resource + "'");
  			}
  		}
  
  		return is;
  	}
docs: Loads a resource as {@link InputStream}.
  
  @param resource
  The resource to be loaded. If {@code baseDir} is not {@code null}, it is loaded
  relative to {@code baseDir}.
  @return The stream