在属性文件中:
FOLDERPATH = C:\预配置/ Import.csv
在Main类中,我将此路径作为方法加载
的参数传递Properties pro = new Properties();
new CSV().load(con,"pro.FolderPath", "VALIDATION");
但它给出了错误:
pro.getProperty(FolderPath) (The system cannot find the file specified.)
请将此路径作为参数传递给方法。
答案 0 :(得分:3)
您需要先加载属性文件:
FileReader reader = new FileReader( "your properties file path" );
Properties prop2 = new Properties();
prop2.load( reader );
prop2.list( System.out );