src/main/java/chalmers/pimp/util/Resources.java
public static URL find(Class<?> context, String path) throws IOException {
    Objects.requireNonNull(context);
    Objects.requireNonNull(path);

    URL result = context.getClassLoader().getResource(path);
    if (result == null) {
      throw new IOException("Failed to find resource: " + path);
    }
    return result;
  }
/**
   * Finds the resource at the given path and returns it.
   *
   * @param context the context class (the encapsulating class of the code that invoked this
   *                method).
   * @param path    the path of the desired resource.
   * @return the URL of the found resource.
   * @throws NullPointerException if any arguments are {@code null}.
   * @throws IOException          if the resource isn't found.
   */
Finds the resource at the given path and returns it.
@param context the context class (the encapsulating class of the code that invoked this
method).
@param path    the path of the desired resource.
@return the URL of the found resource.
@throws NullPointerException if any arguments are  null.
@throws IOException          if the resource isn't found.
Finds the resource at the given path and returns it . @param context the context class ( the encapsulating class of the code that invoked this method ) . @param path the path of the desired resource . @return the URL of the found resource . @throws NullPointerException if any arguments are null . @throws IOException if the resource isn ' t found .
public static URL find(Class<?> context, String path) throws IOException {
    Objects.requireNonNull(context);
    Objects.requireNonNull(path);
    URL result = context.getClassLoader().getResource(path);
    if (result == null) {
      throw new IOException("Failed to find resource: " + path);
    }
    return result;
  }
public static URL find ( Class < ? > context , String path ) throws IOException { Objects . requireNonNull ( context ) ; Objects . requireNonNull ( path ) ; URL result = context . getClassLoader ( ) . getResource ( path ) ; if ( result == null ) { throw new IOException ( "Failed to find resource: " + path ) ; } return result ; }
Finds the resource at the given path and returns it.
Finds the resource at the given path and returns it .