public static String getClassRootPath(Class<?> c) {
		String strClassPathName = getClassPathName(c);

		ClassLoader cl = c.getClassLoader();
		if (cl == null)
			return null;

		URL urlClass = cl.getResource(strClassPathName);
		if (urlClass == null)
			return null;

		String strUrl = urlClass.toString();
		return strUrl.substring(0, strUrl.lastIndexOf(strClassPathName));
	}
public static String getClassRootPath ( Class < ? > c ) { String strClassPathName = getClassPathName ( c ) ; ClassLoader cl = c . getClassLoader ( ) ; if ( cl == null ) return null ; URL urlClass = cl . getResource ( strClassPathName ) ; if ( urlClass == null ) return null ; String strUrl = urlClass . toString ( ) ; return strUrl . substring ( 0 , strUrl . lastIndexOf ( strClassPathName ) ) ; }
返回指定类的Class Loader用于加载该类的Class Path。返回的字符串以/结尾