Java ClassLoader Load getFileFullPath(String file)

Here you can find the source of getFileFullPath(String file)

Description

get File Full Path

License

Apache License

Declaration

public static String getFileFullPath(String file) 

Method Source Code


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

import java.io.File;
import java.net.URL;

public class Main {
    public static String getFileFullPath(String file) {
        String path = ResourcePath(file);
        File fileTmp = new File(path);
        if (fileTmp.exists()) {
            return path;
        }/*  www . j  a  v  a 2  s .c  om*/
        return null;
    }

    public static String ResourcePath(String name) {
        URL url = Thread.currentThread().getContextClassLoader().getResource(name);
        if (url != null) {
            return url.getPath();
        }
        return name;
    }
}

Related

  1. getFile(Object obj, String filename)
  2. getFileContents(String filename)
  3. getFileContents(String path)
  4. getFileFromPath(Object obj, String fileName)
  5. getFileFromPool(String path)
  6. getFilesInPackage(String packageName)
  7. getFullPathByPkg(String pkg)
  8. getImageFilename(String name)
  9. getInputStream(String name)