Java Resource Get getResource(Class c, String name)

Here you can find the source of getResource(Class c, String name)

Description

get Resource

License

Open Source License

Declaration

public static String getResource(Class<?> c, String name) 

Method Source Code

//package com.java2s;

import java.net.URISyntaxException;

public class Main {
    public static String getResource(Class<?> c, String name) {
        try {/*from w  ww  .j  a  v a  2s  .  c o m*/
            return c.getResource(name).toURI().toString();
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. getResource(Class _class, String resource)
  2. getResource(Class baseclass, String name)
  3. getResource(Class clazz, String resource)
  4. getResource(Class controllerClass)
  5. getResource(Class testClass, String resource)
  6. getResource(final Class clazz, final String res)