Java Resource Get getResource(final Class clazz, final String res)

Here you can find the source of getResource(final Class clazz, final String res)

Description

get Resource

License

Open Source License

Declaration

private static URL getResource(final Class clazz, final String res) 

Method Source Code


//package com.java2s;
import java.net.URL;

public class Main {
    private static URL getResource(final Class clazz, final String res) {
        final URL url = clazz.getResource(res);
        if (url == null) {
            throw new RuntimeException("Resource '" + res + "' not found!");
        } else {/*from w w  w .j  a  v a  2  s  . c om*/
            return url;
        }
    }
}

Related

  1. getResource(Class baseclass, String name)
  2. getResource(Class c, String name)
  3. getResource(Class clazz, String resource)
  4. getResource(Class controllerClass)
  5. getResource(Class testClass, String resource)
  6. getResource(final Class aClass, final String aName)
  7. getResource(final String name)
  8. getResource(final String res)
  9. getResource(final String resource)