public static String absolute(String path, ClassLoader klassLoader, String enc) {
        path = normalize(path, enc);
        if (Strings.isEmpty(path))
            return null;

        File f = new File(path);
        if (!f.exists()) {
            URL url = null;
            try {
                url = klassLoader.getResource(path);
                if (null == url)
                    url = Thread.currentThread().getContextClassLoader().getResource(path);
                if (null == url)
                    url = ClassLoader.getSystemResource(path);
            }
            catch (Throwable e) {}
            if (null != url)
                return normalize(url.getPath(), Encoding.UTF8);// 通过URL获取String,一律使用UTF-8编码进行解码
            return null;
        }
        return path;
    }
public static String absolute(String path, ClassLoader klassLoader, String enc) {
        path = normalize(path, enc);
        if (Strings.isEmpty(path))
            return null;

        File f = new File(path);
        if (!f.exists()) {
            URL url = null;
            try {
                url = klassLoader.getResource(path);
                if (null == url)
                    url = Thread.currentThread().getContextClassLoader().getResource(path);
                if (null == url)
                    url = ClassLoader.getSystemResource(path);
            }
            catch (Throwable e) {}
            if (null != url)
                return normalize(url.getPath(), Encoding.UTF8);
            return null;
        }
        return path;
    }
public static String absolute ( String path , ClassLoader klassLoader , String enc ) { path = normalize ( path , enc ) ; if ( Strings . isEmpty ( path ) ) return null ; File f = new File ( path ) ; if ( ! f . exists ( ) ) { URL url = null ; try { url = klassLoader . getResource ( path ) ; if ( null == url ) url = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( path ) ; if ( null == url ) url = ClassLoader . getSystemResource ( path ) ; } catch ( Throwable e ) { } if ( null != url ) return normalize ( url . getPath ( ) , Encoding . UTF8 ) ; // 通过URL获取String,一律使用UTF-8编码进行解码
 return null ; } return path ; }
获取一个路径的绝对路径。如果该路径不存在，则返回null

@param path
路径
@param klassLoader
参考 ClassLoader
@param enc
路径编码方式
@return 绝对路径
获取一个路径的绝对路径。如果该路径不存在，则返回null