Java Resource Path Get getResourcePath(Class clazz, String fileName)

Here you can find the source of getResourcePath(Class clazz, String fileName)

Description

get Resource Path

License

Apache License

Declaration

public static String getResourcePath(Class<?> clazz, String fileName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URL;

public class Main {
    public static String getResourcePath(Class<?> clazz, String fileName) {
        URL resource = clazz.getResource(fileName);
        return resource == null ? null : resource.getPath();
    }//from w  ww.  java  2s.  c o  m
}

Related

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