code: public static File getFileForResource(final String resourcePath) {
          URL path = ResourceUtil.class.getResource(resourcePath);
          if (path == null) {
              path = ResourceUtil.class.getResource("/");
              return new File(new File(path.getPath()), resourcePath);
          }
  
          return new File(path.getPath());
      }
docs: Convert a resource path to a File object.
  
  @param resourcePath The resource-relative path to resolve.
  @return A file instance representing the resource in question.