文件位置:
代码:
public static Properties getProperties(){ Properties pts = new Properties (); FileInputStream in = null; try{ String path = UtilManager.class.getResource("/").getPath(); String websiteURL = (path.replace("/build/classes", "").replace("%20"," ").replace("classes/", "") + "wsdl.properties").replaceFirst("/", ""); System.out.println ("websiteURL:"+websiteURL); in = new FileInputStream(websiteURL); pts.load(in); }catch (FileNotFoundException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); } return pts; }