@@ -0,0 +1,847 @@
+package com.qikemi.packages.utils;%0D%0A%0D%0A/**%0D%0A * System UTIL %0D%0A * @author a.b@hotmail.com xiexianbin%0D%0A *%0D%0A */%0D%0Apublic class SystemUtil %7B%0D%0A%0D%0A%09private static String rootPath = null;%0D%0A%09%0D%0A%09/**%0D%0A%09 * GET Project Root Path %0D%0A%09 * @return%0D%0A%09 * %09%09/var/opt/tomcat/../project_name/%0D%0A%09 */%0D%0A%09public static String getProjectRootPath()%7B%0D%0A%09%09if(rootPath == null)%7B%0D%0A%09%09%09String classesPath = SystemUtil.class.getClassLoader().getResource(%22%22).getPath().replaceFirst(%22/%22, %22%22).trim();%0D%0A%09%09%09// java%0D%0A%09%09%09if(classesPath.endsWith(%22build/classes/%22)) %7B%0D%0A%09%09%09%09rootPath = classesPath.replace(%22build/classes/%22, %22%22);%0D%0A%09%09%09%7Delse if(classesPath.endsWith(%22WEB-INF/classes/%22))%7B%0D%0A%09%09%09%09// java web %0D%0A%09%09%09%09rootPath = classesPath.replace(%22WEB-INF/classes/%22, %22%22);%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09return rootPath;%0D%0A%09%7D%0D%0A%09%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09System.out.println(getProjectRootPath());%0D%0A%09%7D%0D%0A%7D%0D%0A

add system utils