String strPath = getClass().getClassLoader().getResource("").getPath();
/E:/软件安装/apache-tomcat-7.0.25/webapps/hbzh/WEB-INF/classes/
修改window环境下和linux环境下的不同路径
if ("\\".equals(File.separator))
{
strPath = strPath.substring(1).replaceAll("/", "\\\\");
if (strPath.indexOf("classes") > 0) {
strPath = strPath.replace("classes", "uploads\\weather");
}
}
else if (strPath.indexOf("classes") > 0) {
strPath = strPath.replace("classes", "uploads/weather");
}