0

在属性文件中:

FolderPath =C:\pre-configured/Import.csv

在主类中,我将此路径作为方法加载的参数传递

Properties pro = new Properties();
new CSV().load(con,"pro.FolderPath", "VALIDATION");

但它给出的错误是:

pro.getProperty(FolderPath) (The system cannot find the file specified.)

请帮助将此路径作为参数传递给方法。

4

1 回答 1

3

您需要先加载一个属性文件:

FileReader reader = new FileReader( "your properties file path" );

Properties prop2 = new Properties();
prop2.load( reader );
prop2.list( System.out );
于 2013-08-18T18:34:35.253 回答