String url=null;
try {
url = URLDecoder.decode(this.getClass().getResource("").getFile(),"utf-8");
} catch (UnsupportedEncodingException e3) {
// TODO Auto-generated catch block
e3.printStackTrace();
}
//去掉路径信息中的协议名"file:"
int pos=url.indexOf("file:");
if(pos>-1) {
url=url.substring(pos+5);
}
url=url.substring(0, url.indexOf("file_planmanage"));
url=url.replace("/", "\\");
programpath=url+"file_planmanage"; //D:\\Program Files\\Apache Software Foundation\\Tomcat 7.0\\webapps\\attach\\file_planmanage
try {
url = URLDecoder.decode(this.getClass().getResource("").getFile(),"utf-8");
} catch (UnsupportedEncodingException e3) {
// TODO Auto-generated catch block
e3.printStackTrace();
}
//去掉路径信息中的协议名"file:"
int pos=url.indexOf("file:");
if(pos>-1) {
url=url.substring(pos+5);
}
url=url.substring(0, url.indexOf("file_planmanage"));
url=url.replace("/", "\\");
programpath=url+"file_planmanage"; //D:\\Program Files\\Apache Software Foundation\\Tomcat 7.0\\webapps\\attach\\file_planmanage