code: public static File getFileFromClasspath(final String filePath) throws FileNotFoundException {
          try {
              URL fileURL = FileUtils.class.getClassLoader().getResource(filePath);
              if (fileURL == null) {
                  throw new FileNotFoundException("File [" + filePath + "] could not be found in classpath");
              }
              return new File(fileURL.toURI());
          } catch (URISyntaxException e) {
              throw new FileNotFoundException("File [" + filePath + "] could not be found: " + e.getMessage());
          }
      }
docs: Searches the classpath for the file denoted by the file path and returns
  the corresponding file.
  
  @param filePath
  path to the file
  @return a file corresponding to the path
  @throws FileNotFoundException
  if the file cannot be found