得到java文件里的配置文件路径

//----------------------获取/WEB-INF/conf/MakePrepare.txt 配置文件里的信息---------------------
  String path = getClass().getClassLoader().getResource("").getPath();
  path = path.replace("classes", "conf");
  try {
      path = java.net.URLDecoder.decode(path,"utf-8");
  }

  catch (UnsupportedEncodingException e) {
       e.printStackTrace();
  }
  String papertype = DoProperties.getProperties("papertype", path+"MakePrepare.txt");

 

 

 


String path = this.getClass().getResource("/").getPath();

你可能感兴趣的:(java,Web,.net)