code: public static File getResourceAsFile(ClassLoader loader, String resource) throws IOException {
          return new File(getResourceURL(loader, resource).getFile());
      }
docs: Returns a resource on the classpath as a File object
  
  @param loader
  The classloader used to load the resource
  @param resource
  The resource to find
  @throws IOException
  If the resource cannot be found or read
  @return The resource