Java Resource Path Get getResourcePath(String name)

Here you can find the source of getResourcePath(String name)

Description

get Resource Path

License

Mozilla Public License

Declaration

public static String getResourcePath(String name) 

Method Source Code

//package com.java2s;
//License from project: Mozilla Public License 

import java.net.URL;

public class Main {

    public static String getResourcePath(String name) {
        URL pathUrl = Thread.currentThread().getContextClassLoader().getResource(name);
        if (pathUrl != null) {
            return pathUrl.getPath();
        }/* w  w w.  j  av  a  2s .co  m*/
        return null;
    }
}

Related

  1. getResourcePath(Class clazz, String fileName)
  2. getResourcePath(final Class bundleClazz, final String pathToFile)
  3. getResourcePath(Object object, String resource)
  4. getResourcePath(String filename)
  5. getResourcePath(String fileName)
  6. getResourcePath(String path)
  7. getResourcePath(String resource)
  8. getResourcePath(String resource)
  9. getResources(ClassLoader cl, String resourcePath)