java - Add properties file for custom plugin in Nutch -
i'm beginner in nutch. have done crawling, created custom plugin based on different tutorials. particular task, java class have use properties file named sample.properties
tasks. i've getting nullpointerexception on following code.
properties property = new properties(); inputstream input = getclass().getresourceasstream("sample.properties"); property.load(input);
i don't know place properties file, because doesn't moves compiled jar after compiling ant. i'm placing @ same directory of java class. appreciated.
i solved adding copy task in plugin's build.xml
:
<copy todir="${build.classes}"> <fileset dir="${src.dir}" includes="**/*.properties"/> </copy>
it copies properties file compiled jar , issue solved. cheers !!
edit :
i used method also. moved properties file conf directory , input in parsefilter by,
properties property = new properties(); inputstream input = classloader.getsystemresourceasstream("sample.properties"); property.load(input);
Comments
Post a Comment